public class BinaryWriterExImpl extends Object implements BinaryWriter, BinaryRawWriterEx, ObjectOutput
| Constructor and Description |
|---|
BinaryWriterExImpl(BinaryContext ctx) |
BinaryWriterExImpl(BinaryContext ctx,
BinaryOutputStream out,
BinaryWriterSchemaHolder schema,
BinaryWriterHandles handles) |
BinaryWriterExImpl(BinaryContext ctx,
BinaryThreadLocalContext tlsCtx) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
array() |
void |
close()
Close the writer releasing resources if necessary.
|
BinaryContext |
context() |
BinarySchema |
currentSchema() |
void |
doWriteBinaryObject(BinaryObjectImpl po) |
void |
doWriteDate(Date date) |
void |
doWriteDecimal(BigDecimal val) |
void |
doWriteObject(Object obj)
Write object.
|
void |
doWriteProxy(Proxy proxy,
Class<?>[] intfs) |
void |
doWriteString(String val) |
void |
doWriteTime(Time time) |
void |
doWriteTimestamp(Timestamp ts) |
void |
doWriteUuid(UUID uuid) |
boolean |
failIfUnregistered() |
void |
failIfUnregistered(boolean failIfUnregistered) |
void |
flush() |
BinaryWriterExImpl |
newWriter(int typeId)
Create new writer with same context.
|
BinaryOutputStream |
out() |
void |
popSchema()
Pop schema.
|
void |
postWrite(boolean userType,
boolean registered)
Perform post-write.
|
void |
postWriteHashCode(String clsName)
Perform post-write hash code update if necessary.
|
void |
preWrite(String clsName)
Perform pre-write.
|
BinaryRawWriter |
rawWriter()
Gets raw writer.
|
int |
reserveInt()
Reserve a room for an integer.
|
int |
schemaId() |
void |
schemaId(int schemaId) |
void |
typeId(int typeId) |
void |
write(byte[] val) |
void |
write(byte[] val,
int off,
int len) |
void |
write(int b) |
void |
writeBoolean(boolean val) |
void |
writeBoolean(String fieldName,
boolean val) |
void |
writeBooleanArray(boolean[] val) |
void |
writeBooleanArray(String fieldName,
boolean[] val) |
void |
writeBooleanFieldPrimitive(boolean val) |
void |
writeByte(byte val) |
void |
writeByte(int v) |
void |
writeByte(String fieldName,
byte val) |
void |
writeByteArray(byte[] val) |
void |
writeByteArray(String fieldName,
byte[] val) |
void |
writeByteFieldPrimitive(byte val) |
void |
writeBytes(String s) |
void |
writeChar(char val) |
void |
writeChar(int v) |
void |
writeChar(String fieldName,
char val) |
void |
writeCharArray(char[] val) |
void |
writeCharArray(String fieldName,
char[] val) |
void |
writeCharFieldPrimitive(char val) |
void |
writeChars(String s) |
<T> void |
writeCollection(Collection<T> col) |
<T> void |
writeCollection(String fieldName,
Collection<T> col) |
void |
writeDate(Date val) |
void |
writeDate(String fieldName,
Date val) |
void |
writeDateArray(Date[] val) |
void |
writeDateArray(String fieldName,
Date[] val) |
void |
writeDecimal(BigDecimal val) |
void |
writeDecimal(String fieldName,
BigDecimal val) |
void |
writeDecimalArray(BigDecimal[] val) |
void |
writeDecimalArray(String fieldName,
BigDecimal[] val) |
void |
writeDouble(double val) |
void |
writeDouble(String fieldName,
double val) |
void |
writeDoubleArray(double[] val) |
void |
writeDoubleArray(String fieldName,
double[] val) |
void |
writeDoubleFieldPrimitive(double val) |
<T extends Enum<?>> |
writeEnum(String fieldName,
T val) |
<T extends Enum<?>> |
writeEnum(T val) |
<T extends Enum<?>> |
writeEnumArray(String fieldName,
T[] val) |
<T extends Enum<?>> |
writeEnumArray(T[] val) |
void |
writeFieldId(int fieldId)
Write field ID.
|
void |
writeFieldIdNoSchemaUpdate(int fieldId)
Write field ID without schema ID update.
|
void |
writeFloat(float val) |
void |
writeFloat(String fieldName,
float val) |
void |
writeFloatArray(float[] val) |
void |
writeFloatArray(String fieldName,
float[] val) |
void |
writeFloatFieldPrimitive(float val) |
void |
writeInt(int val) |
void |
writeInt(int pos,
int val)
Write int value at the specific position.
|
void |
writeInt(String fieldName,
int val) |
void |
writeIntArray(int[] val) |
void |
writeIntArray(String fieldName,
int[] val) |
void |
writeIntFieldPrimitive(int val) |
void |
writeLong(long val) |
void |
writeLong(String fieldName,
long val) |
void |
writeLongArray(long[] val) |
void |
writeLongArray(String fieldName,
long[] val) |
void |
writeLongFieldPrimitive(long val) |
<K,V> void |
writeMap(Map<K,V> map) |
<K,V> void |
writeMap(String fieldName,
Map<K,V> map) |
void |
writeObject(Object obj) |
void |
writeObject(String fieldName,
Object obj) |
void |
writeObjectArray(Object[] val) |
void |
writeObjectArray(String fieldName,
Object[] val) |
void |
writeObjectDetached(Object obj) |
void |
writeShort(int v) |
void |
writeShort(short val) |
void |
writeShort(String fieldName,
short val) |
void |
writeShortArray(short[] val) |
void |
writeShortArray(String fieldName,
short[] val) |
void |
writeShortFieldPrimitive(short val) |
void |
writeString(String val) |
void |
writeString(String fieldName,
String val) |
void |
writeStringArray(String[] val) |
void |
writeStringArray(String fieldName,
String[] val) |
void |
writeTime(String fieldName,
Time val) |
void |
writeTime(Time val) |
void |
writeTimeArray(String fieldName,
Time[] val) |
void |
writeTimeArray(Time[] val) |
void |
writeTimestamp(String fieldName,
Timestamp val) |
void |
writeTimestamp(Timestamp val) |
void |
writeTimestampArray(String fieldName,
Timestamp[] val) |
void |
writeTimestampArray(Timestamp[] val) |
void |
writeUTF(String s) |
void |
writeUuid(String fieldName,
UUID val) |
void |
writeUuid(UUID val) |
void |
writeUuidArray(String fieldName,
UUID[] val) |
void |
writeUuidArray(UUID[] val) |
public BinaryWriterExImpl(BinaryContext ctx)
ctx - Context.public BinaryWriterExImpl(BinaryContext ctx, BinaryThreadLocalContext tlsCtx)
ctx - Context.tlsCtx - TLS context.public BinaryWriterExImpl(BinaryContext ctx, BinaryOutputStream out, BinaryWriterSchemaHolder schema, BinaryWriterHandles handles)
ctx - Context.out - Output stream.handles - Handles.public boolean failIfUnregistered()
public void failIfUnregistered(boolean failIfUnregistered)
failIfUnregistered - Fail if unregistered.public void typeId(int typeId)
typeId - Type ID.public void close()
close in interface ObjectOutputclose in interface AutoCloseableclose in interface BinaryRawWriterExpublic byte[] array()
public void preWrite(@Nullable
String clsName)
clsName - Class name (optional).public void postWrite(boolean userType,
boolean registered)
userType - User type flag.registered - Whether type is registered.public void postWriteHashCode(@Nullable
String clsName)
clsName - Class name. Always null if class is registered.public void popSchema()
public void write(byte[] val)
write in interface DataOutputwrite in interface ObjectOutputval - Byte array.public void write(byte[] val,
int off,
int len)
write in interface DataOutputwrite in interface ObjectOutputval - Byte array.off - Offset.len - Length.public void doWriteDecimal(@Nullable
BigDecimal val)
val - String value.public void doWriteString(@Nullable
String val)
val - String value.public void doWriteUuid(@Nullable
UUID uuid)
uuid - UUID.public void doWriteDate(@Nullable
Date date)
date - Date.public void doWriteTimestamp(@Nullable
Timestamp ts)
ts - Timestamp.public void doWriteTime(@Nullable
Time time)
time - Time.public void doWriteObject(@Nullable
Object obj)
throws BinaryObjectException
obj - Object.BinaryObjectException - In case of error.public void doWriteBinaryObject(@Nullable
BinaryObjectImpl po)
po - Binary object.public void writeByteFieldPrimitive(byte val)
val - Value.public void writeShortFieldPrimitive(short val)
val - Value.public void writeIntFieldPrimitive(int val)
val - Value.public void writeLongFieldPrimitive(long val)
val - Value.public void writeFloatFieldPrimitive(float val)
val - Value.public void writeDoubleFieldPrimitive(double val)
val - Value.public void writeCharFieldPrimitive(char val)
val - Value.public void writeBooleanFieldPrimitive(boolean val)
val - Value.public void writeByte(String fieldName, byte val) throws BinaryObjectException
writeByte in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeByte(byte val)
throws BinaryObjectException
writeByte in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeShort(String fieldName, short val) throws BinaryObjectException
writeShort in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeShort(short val)
throws BinaryObjectException
writeShort in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeInt(String fieldName, int val) throws BinaryObjectException
writeInt in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeInt(int val)
throws BinaryObjectException
writeInt in interface DataOutputwriteInt in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeLong(String fieldName, long val) throws BinaryObjectException
writeLong in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeLong(long val)
throws BinaryObjectException
writeLong in interface DataOutputwriteLong in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeFloat(String fieldName, float val) throws BinaryObjectException
writeFloat in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeFloat(float val)
throws BinaryObjectException
writeFloat in interface DataOutputwriteFloat in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeDouble(String fieldName, double val) throws BinaryObjectException
writeDouble in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeDouble(double val)
throws BinaryObjectException
writeDouble in interface DataOutputwriteDouble in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeChar(String fieldName, char val) throws BinaryObjectException
writeChar in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeChar(char val)
throws BinaryObjectException
writeChar in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeBoolean(String fieldName, boolean val) throws BinaryObjectException
writeBoolean in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeBoolean(boolean val)
throws BinaryObjectException
writeBoolean in interface DataOutputwriteBoolean in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeDecimal(String fieldName, @Nullable BigDecimal val) throws BinaryObjectException
writeDecimal in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeDecimal(@Nullable
BigDecimal val)
throws BinaryObjectException
writeDecimal in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeString(String fieldName, @Nullable String val) throws BinaryObjectException
writeString in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeString(@Nullable
String val)
throws BinaryObjectException
writeString in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeUuid(String fieldName, @Nullable UUID val) throws BinaryObjectException
writeUuid in interface BinaryWriterfieldName - Field name.val - UUID to write.BinaryObjectException - In case of error.public void writeUuid(@Nullable
UUID val)
throws BinaryObjectException
writeUuid in interface BinaryRawWriterval - UUID to write.BinaryObjectException - In case of error.public void writeDate(String fieldName, @Nullable Date val) throws BinaryObjectException
writeDate in interface BinaryWriterfieldName - Field name.val - Date to write.BinaryObjectException - In case of error.public void writeDate(@Nullable
Date val)
throws BinaryObjectException
writeDate in interface BinaryRawWriterval - Date to write.BinaryObjectException - In case of error.public void writeTimestamp(String fieldName, @Nullable Timestamp val) throws BinaryObjectException
writeTimestamp in interface BinaryWriterfieldName - Field name.val - Timestamp to write.BinaryObjectException - In case of error.public void writeTimestamp(@Nullable
Timestamp val)
throws BinaryObjectException
writeTimestamp in interface BinaryRawWriterval - Timestamp to write.BinaryObjectException - In case of error.public void writeTime(String fieldName, @Nullable Time val) throws BinaryObjectException
writeTime in interface BinaryWriterfieldName - Field name.val - Time to write.BinaryObjectException - In case of error.public void writeTime(@Nullable
Time val)
throws BinaryObjectException
writeTime in interface BinaryRawWriterval - Time to write.BinaryObjectException - In case of error.public void writeObject(String fieldName, @Nullable Object obj) throws BinaryObjectException
writeObject in interface BinaryWriterfieldName - Field name.obj - Value to write.BinaryObjectException - In case of error.public void writeObject(@Nullable
Object obj)
throws BinaryObjectException
writeObject in interface ObjectOutputwriteObject in interface BinaryRawWriterobj - Value to write.BinaryObjectException - In case of error.public void writeObjectDetached(@Nullable
Object obj)
throws BinaryObjectException
writeObjectDetached in interface BinaryRawWriterExobj - Object to write.BinaryObjectException - In case of error.public void writeByteArray(String fieldName, @Nullable byte[] val) throws BinaryObjectException
writeByteArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeByteArray(@Nullable
byte[] val)
throws BinaryObjectException
writeByteArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeShortArray(String fieldName, @Nullable short[] val) throws BinaryObjectException
writeShortArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeShortArray(@Nullable
short[] val)
throws BinaryObjectException
writeShortArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeIntArray(String fieldName, @Nullable int[] val) throws BinaryObjectException
writeIntArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeIntArray(@Nullable
int[] val)
throws BinaryObjectException
writeIntArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeLongArray(String fieldName, @Nullable long[] val) throws BinaryObjectException
writeLongArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeLongArray(@Nullable
long[] val)
throws BinaryObjectException
writeLongArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeFloatArray(String fieldName, @Nullable float[] val) throws BinaryObjectException
writeFloatArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeFloatArray(@Nullable
float[] val)
throws BinaryObjectException
writeFloatArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeDoubleArray(String fieldName, @Nullable double[] val) throws BinaryObjectException
writeDoubleArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeDoubleArray(@Nullable
double[] val)
throws BinaryObjectException
writeDoubleArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeCharArray(String fieldName, @Nullable char[] val) throws BinaryObjectException
writeCharArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeCharArray(@Nullable
char[] val)
throws BinaryObjectException
writeCharArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeBooleanArray(String fieldName, @Nullable boolean[] val) throws BinaryObjectException
writeBooleanArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeBooleanArray(@Nullable
boolean[] val)
throws BinaryObjectException
writeBooleanArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeDecimalArray(String fieldName, @Nullable BigDecimal[] val) throws BinaryObjectException
writeDecimalArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeDecimalArray(@Nullable
BigDecimal[] val)
throws BinaryObjectException
writeDecimalArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeStringArray(String fieldName, @Nullable String[] val) throws BinaryObjectException
writeStringArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeStringArray(@Nullable
String[] val)
throws BinaryObjectException
writeStringArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeUuidArray(String fieldName, @Nullable UUID[] val) throws BinaryObjectException
writeUuidArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeUuidArray(@Nullable
UUID[] val)
throws BinaryObjectException
writeUuidArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeDateArray(String fieldName, @Nullable Date[] val) throws BinaryObjectException
writeDateArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeDateArray(@Nullable
Date[] val)
throws BinaryObjectException
writeDateArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeTimestampArray(String fieldName, @Nullable Timestamp[] val) throws BinaryObjectException
writeTimestampArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeTimestampArray(@Nullable
Timestamp[] val)
throws BinaryObjectException
writeTimestampArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeTimeArray(String fieldName, @Nullable Time[] val) throws BinaryObjectException
writeTimeArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeTimeArray(@Nullable
Time[] val)
throws BinaryObjectException
writeTimeArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public void writeObjectArray(String fieldName, @Nullable Object[] val) throws BinaryObjectException
writeObjectArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public void writeObjectArray(@Nullable
Object[] val)
throws BinaryObjectException
writeObjectArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public <T> void writeCollection(String fieldName, @Nullable Collection<T> col) throws BinaryObjectException
writeCollection in interface BinaryWriterfieldName - Field name.col - Collection to write.BinaryObjectException - In case of error.public <T> void writeCollection(@Nullable
Collection<T> col)
throws BinaryObjectException
writeCollection in interface BinaryRawWritercol - Collection to write.BinaryObjectException - In case of error.public <K,V> void writeMap(String fieldName, @Nullable Map<K,V> map) throws BinaryObjectException
writeMap in interface BinaryWriterfieldName - Field name.map - Map to write.BinaryObjectException - In case of error.public <K,V> void writeMap(@Nullable
Map<K,V> map)
throws BinaryObjectException
writeMap in interface BinaryRawWritermap - Map to write.BinaryObjectException - In case of error.public <T extends Enum<?>> void writeEnum(String fieldName, T val) throws BinaryObjectException
writeEnum in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public <T extends Enum<?>> void writeEnum(T val) throws BinaryObjectException
writeEnum in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public <T extends Enum<?>> void writeEnumArray(String fieldName, T[] val) throws BinaryObjectException
writeEnumArray in interface BinaryWriterfieldName - Field name.val - Value to write.BinaryObjectException - In case of error.public <T extends Enum<?>> void writeEnumArray(T[] val) throws BinaryObjectException
writeEnumArray in interface BinaryRawWriterval - Value to write.BinaryObjectException - In case of error.public BinaryRawWriter rawWriter()
rawWriter in interface BinaryWriterpublic BinaryOutputStream out()
out in interface BinaryRawWriterExpublic void writeBytes(String s) throws IOException
writeBytes in interface DataOutputIOExceptionpublic void writeChars(String s) throws IOException
writeChars in interface DataOutputIOExceptionpublic void writeUTF(String s) throws IOException
writeUTF in interface DataOutputIOExceptionpublic void writeByte(int v)
throws IOException
writeByte in interface DataOutputIOExceptionpublic void writeShort(int v)
throws IOException
writeShort in interface DataOutputIOExceptionpublic void writeChar(int v)
throws IOException
writeChar in interface DataOutputIOExceptionpublic void write(int b)
throws IOException
write in interface DataOutputwrite in interface ObjectOutputIOExceptionpublic void flush()
throws IOException
flush in interface ObjectOutputIOExceptionpublic int reserveInt()
reserveInt in interface BinaryRawWriterExpublic void writeInt(int pos,
int val)
throws BinaryObjectException
writeInt in interface BinaryRawWriterExpos - Position.val - Value.BinaryObjectException - If failed.public void writeFieldId(int fieldId)
fieldId - Field ID.public void writeFieldIdNoSchemaUpdate(int fieldId)
fieldId - Field ID.public void schemaId(int schemaId)
schemaId - Schema ID.public int schemaId()
public BinarySchema currentSchema()
public BinaryWriterExImpl newWriter(int typeId)
typeId - typepublic BinaryContext context()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.5 Release Date : June 4 2019