public class DefaultPortableWriter extends Object implements PortableWriter
Modifier and Type | Method and Description |
---|---|
ObjectDataOutput |
getRawDataOutput()
After writing portable fields, one can write remaining fields in old fashioned way consecutively at the end
of stream.
|
int |
getVersion() |
void |
writeBoolean(String fieldName,
boolean value)
Writes a primitive boolean.
|
void |
writeBooleanArray(String fieldName,
boolean[] booleans)
Writes a primitive boolean-array.
|
void |
writeByte(String fieldName,
byte value)
Writes a primitive byte.
|
void |
writeByteArray(String fieldName,
byte[] values)
Writes a primitive byte-array.
|
void |
writeChar(String fieldName,
int value)
Writes a primitive char.
|
void |
writeCharArray(String fieldName,
char[] values)
Writes a primitive char-array.
|
void |
writeDouble(String fieldName,
double value)
Writes a primitive double.
|
void |
writeDoubleArray(String fieldName,
double[] values)
Writes a primitive double array.
|
void |
writeFloat(String fieldName,
float value)
Writes a primitive float.
|
void |
writeFloatArray(String fieldName,
float[] values)
Writes a primitive float array.
|
void |
writeInt(String fieldName,
int value)
Writes a primitive int.
|
void |
writeIntArray(String fieldName,
int[] values)
Writes a primitive int-array.
|
void |
writeLong(String fieldName,
long value)
Writes a primitive long.
|
void |
writeLongArray(String fieldName,
long[] values)
Writes a primitive long-array.
|
void |
writeNullPortable(String fieldName,
int factoryId,
int classId)
To write a null portable value, user needs to provide class and factoryIds of related class.
|
void |
writePortable(String fieldName,
Portable portable)
Writes a Portable.
|
void |
writePortableArray(String fieldName,
Portable[] portables)
Writes a an array of Portables.
|
void |
writeShort(String fieldName,
short value)
Writes a primitive short.
|
void |
writeShortArray(String fieldName,
short[] values)
Writes a primitive short-array.
|
void |
writeUTF(String fieldName,
String str)
Writes an UTF string.
|
void |
writeUTFArray(String fieldName,
String[] values)
Writes a String-array.
|
public int getVersion()
public void writeInt(String fieldName, int value) throws IOException
PortableWriter
writeInt
in interface PortableWriter
fieldName
- name of the fieldvalue
- int value to be writtenIOException
public void writeLong(String fieldName, long value) throws IOException
PortableWriter
writeLong
in interface PortableWriter
fieldName
- name of the fieldvalue
- long value to be writtenIOException
public void writeUTF(String fieldName, String str) throws IOException
PortableWriter
writeUTF
in interface PortableWriter
fieldName
- name of the fieldstr
- utf string value to be writtenIOException
public void writeBoolean(String fieldName, boolean value) throws IOException
PortableWriter
writeBoolean
in interface PortableWriter
fieldName
- name of the fieldvalue
- int value to be writtenIOException
public void writeByte(String fieldName, byte value) throws IOException
PortableWriter
writeByte
in interface PortableWriter
fieldName
- name of the fieldvalue
- int value to be writtenIOException
public void writeChar(String fieldName, int value) throws IOException
PortableWriter
writeChar
in interface PortableWriter
fieldName
- name of the fieldvalue
- int value to be writtenIOException
public void writeDouble(String fieldName, double value) throws IOException
PortableWriter
writeDouble
in interface PortableWriter
fieldName
- name of the fieldvalue
- int value to be writtenIOException
public void writeFloat(String fieldName, float value) throws IOException
PortableWriter
writeFloat
in interface PortableWriter
fieldName
- name of the fieldvalue
- int value to be writtenIOException
public void writeShort(String fieldName, short value) throws IOException
PortableWriter
writeShort
in interface PortableWriter
fieldName
- name of the fieldvalue
- int value to be writtenIOException
public void writePortable(String fieldName, Portable portable) throws IOException
PortableWriter
writePortable
in interface PortableWriter
fieldName
- name of the fieldportable
- Portable to be writtenIOException
public void writeNullPortable(String fieldName, int factoryId, int classId) throws IOException
PortableWriter
writeNullPortable
in interface PortableWriter
fieldName
- name of the fieldfactoryId
- factory ID of related portable classclassId
- class ID of related portable classIOException
public void writeByteArray(String fieldName, byte[] values) throws IOException
PortableWriter
writeByteArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- byte array to be writtenIOException
public void writeBooleanArray(String fieldName, boolean[] booleans) throws IOException
PortableWriter
writeBooleanArray
in interface PortableWriter
fieldName
- name of the fieldbooleans
- boolean array to be writtenIOException
public void writeCharArray(String fieldName, char[] values) throws IOException
PortableWriter
writeCharArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- char array to be writtenIOException
public void writeIntArray(String fieldName, int[] values) throws IOException
PortableWriter
writeIntArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- int array to be writtenIOException
public void writeLongArray(String fieldName, long[] values) throws IOException
PortableWriter
writeLongArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- long array to be writtenIOException
public void writeDoubleArray(String fieldName, double[] values) throws IOException
PortableWriter
writeDoubleArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- double array to be writtenIOException
public void writeFloatArray(String fieldName, float[] values) throws IOException
PortableWriter
writeFloatArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- float array to be writtenIOException
public void writeShortArray(String fieldName, short[] values) throws IOException
PortableWriter
writeShortArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- short array to be writtenIOException
public void writeUTFArray(String fieldName, String[] values) throws IOException
PortableWriter
writeUTFArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- String array to be writtenIOException
public void writePortableArray(String fieldName, Portable[] portables) throws IOException
PortableWriter
writePortableArray
in interface PortableWriter
fieldName
- name of the fieldportables
- portable array to be writtenIOException
public ObjectDataOutput getRawDataOutput() throws IOException
PortableWriter
getRawDataOutput
in interface PortableWriter
IOException
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.