public interface BinaryWriter
Binarylizable
implementations.
Useful for the cases when user wants a fine-grained control over serialization.
Note that Ignite never writes full strings for field or type names. Instead,
for performance reasons, Ignite writes integer hash codes for type and field names.
It has been tested that hash code conflicts for the type names or the field names
within the same type are virtually non-existent and, to gain performance, it is safe
to work with hash codes. For the cases when hash codes for different types or fields
actually do collide, Ignite provides BinaryIdMapper
which
allows to override the automatically generated hash code IDs for the type and field names.
Modifier and Type | Method and Description |
---|---|
BinaryRawWriter |
rawWriter()
Gets raw writer.
|
void |
writeBoolean(String fieldName,
boolean val) |
void |
writeBooleanArray(String fieldName,
@Nullable boolean[] val) |
void |
writeByte(String fieldName,
byte val) |
void |
writeByteArray(String fieldName,
@Nullable byte[] val) |
void |
writeChar(String fieldName,
char val) |
void |
writeCharArray(String fieldName,
@Nullable char[] val) |
<T> void |
writeCollection(String fieldName,
@Nullable Collection<T> col) |
void |
writeDate(String fieldName,
@Nullable Date val) |
void |
writeDateArray(String fieldName,
@Nullable Date[] val) |
void |
writeDecimal(String fieldName,
@Nullable BigDecimal val) |
void |
writeDecimalArray(String fieldName,
@Nullable BigDecimal[] val) |
void |
writeDouble(String fieldName,
double val) |
void |
writeDoubleArray(String fieldName,
@Nullable double[] val) |
<T extends Enum<?>> |
writeEnum(String fieldName,
T val) |
<T extends Enum<?>> |
writeEnumArray(String fieldName,
T[] val) |
void |
writeFloat(String fieldName,
float val) |
void |
writeFloatArray(String fieldName,
@Nullable float[] val) |
void |
writeInt(String fieldName,
int val) |
void |
writeIntArray(String fieldName,
@Nullable int[] val) |
void |
writeLong(String fieldName,
long val) |
void |
writeLongArray(String fieldName,
@Nullable long[] val) |
<K,V> void |
writeMap(String fieldName,
@Nullable Map<K,V> map) |
void |
writeObject(String fieldName,
@Nullable Object obj) |
void |
writeObjectArray(String fieldName,
@Nullable Object[] val) |
void |
writeShort(String fieldName,
short val) |
void |
writeShortArray(String fieldName,
@Nullable short[] val) |
void |
writeString(String fieldName,
@Nullable String val) |
void |
writeStringArray(String fieldName,
@Nullable String[] val) |
void |
writeTime(String fieldName,
@Nullable Time val) |
void |
writeTimeArray(String fieldName,
@Nullable Time[] val) |
void |
writeTimestamp(String fieldName,
@Nullable Timestamp val) |
void |
writeTimestampArray(String fieldName,
@Nullable Timestamp[] val) |
void |
writeUuid(String fieldName,
@Nullable UUID val) |
void |
writeUuidArray(String fieldName,
@Nullable UUID[] val) |
void writeByte(String fieldName, byte val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeShort(String fieldName, short val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeInt(String fieldName, int val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeLong(String fieldName, long val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeFloat(String fieldName, float val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeDouble(String fieldName, double val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeChar(String fieldName, char val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeBoolean(String fieldName, boolean val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeDecimal(String fieldName, @Nullable @Nullable BigDecimal val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeString(String fieldName, @Nullable @Nullable String val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeUuid(String fieldName, @Nullable @Nullable UUID val) throws BinaryObjectException
fieldName
- Field name.val
- UUID to write.BinaryObjectException
- In case of error.void writeDate(String fieldName, @Nullable @Nullable Date val) throws BinaryObjectException
fieldName
- Field name.val
- Date to write.BinaryObjectException
- In case of error.void writeTimestamp(String fieldName, @Nullable @Nullable Timestamp val) throws BinaryObjectException
fieldName
- Field name.val
- Timestamp to write.BinaryObjectException
- In case of error.void writeTime(String fieldName, @Nullable @Nullable Time val) throws BinaryObjectException
fieldName
- Field name.val
- Time to write.BinaryObjectException
- In case of error.void writeObject(String fieldName, @Nullable @Nullable Object obj) throws BinaryObjectException
fieldName
- Field name.obj
- Value to write.BinaryObjectException
- In case of error.void writeByteArray(String fieldName, @Nullable @Nullable byte[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeShortArray(String fieldName, @Nullable @Nullable short[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeIntArray(String fieldName, @Nullable @Nullable int[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeLongArray(String fieldName, @Nullable @Nullable long[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeFloatArray(String fieldName, @Nullable @Nullable float[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeDoubleArray(String fieldName, @Nullable @Nullable double[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeCharArray(String fieldName, @Nullable @Nullable char[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeBooleanArray(String fieldName, @Nullable @Nullable boolean[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeDecimalArray(String fieldName, @Nullable @Nullable BigDecimal[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeStringArray(String fieldName, @Nullable @Nullable String[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeUuidArray(String fieldName, @Nullable @Nullable UUID[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeDateArray(String fieldName, @Nullable @Nullable Date[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeTimestampArray(String fieldName, @Nullable @Nullable Timestamp[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeTimeArray(String fieldName, @Nullable @Nullable Time[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.void writeObjectArray(String fieldName, @Nullable @Nullable Object[] val) throws BinaryObjectException
fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.<T> void writeCollection(String fieldName, @Nullable @Nullable Collection<T> col) throws BinaryObjectException
T
- Type of elements in collection to write.fieldName
- Field name.col
- Collection to write.BinaryObjectException
- In case of error.<K,V> void writeMap(String fieldName, @Nullable @Nullable Map<K,V> map) throws BinaryObjectException
K
- Type of keys in the map to write.V
- Type of mapped values in the map to write.fieldName
- Field name.map
- Map to write.BinaryObjectException
- In case of error.<T extends Enum<?>> void writeEnum(String fieldName, T val) throws BinaryObjectException
T
- Type of the enum to write.fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.<T extends Enum<?>> void writeEnumArray(String fieldName, T[] val) throws BinaryObjectException
T
- Type of the enum values in array to write.fieldName
- Field name.val
- Value to write.BinaryObjectException
- In case of error.BinaryRawWriter rawWriter()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023