public class DefaultPortableWriter extends Object implements PortableWriter
Constructor and Description |
---|
DefaultPortableWriter(com.hazelcast.nio.serialization.PortableSerializer serializer,
com.hazelcast.nio.BufferObjectDataOutput out,
ClassDefinition cd) |
Modifier and Type | Method and Description |
---|---|
com.hazelcast.nio.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) |
void |
writeByte(String fieldName,
byte value) |
void |
writeByteArray(String fieldName,
byte[] values) |
void |
writeChar(String fieldName,
int value) |
void |
writeCharArray(String fieldName,
char[] values) |
void |
writeDouble(String fieldName,
double value) |
void |
writeDoubleArray(String fieldName,
double[] values) |
void |
writeFloat(String fieldName,
float value) |
void |
writeFloatArray(String fieldName,
float[] values) |
void |
writeInt(String fieldName,
int value) |
void |
writeIntArray(String fieldName,
int[] values) |
void |
writeLong(String fieldName,
long value) |
void |
writeLongArray(String fieldName,
long[] values) |
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) |
void |
writePortableArray(String fieldName,
Portable[] portables) |
void |
writeShort(String fieldName,
short value) |
void |
writeShortArray(String fieldName,
short[] values) |
void |
writeUTF(String fieldName,
String str) |
public DefaultPortableWriter(com.hazelcast.nio.serialization.PortableSerializer serializer, com.hazelcast.nio.BufferObjectDataOutput out, ClassDefinition cd) throws IOException
IOException
public int getVersion()
public void writeInt(String fieldName, int value) throws IOException
writeInt
in interface PortableWriter
fieldName
- name of the fieldvalue
- int value to be writtenIOException
public void writeLong(String fieldName, long value) throws IOException
writeLong
in interface PortableWriter
fieldName
- name of the fieldvalue
- long value to be writtenIOException
public void writeUTF(String fieldName, String str) throws IOException
writeUTF
in interface PortableWriter
fieldName
- name of the fieldstr
- utf string value to be writtenIOException
public void writeBoolean(String fieldName, boolean value) throws IOException
writeBoolean
in interface PortableWriter
fieldName
- name of the fieldvalue
- int value to be writtenIOException
public void writeByte(String fieldName, byte value) throws IOException
writeByte
in interface PortableWriter
fieldName
- name of the fieldvalue
- int value to be writtenIOException
public void writeChar(String fieldName, int value) throws IOException
writeChar
in interface PortableWriter
fieldName
- name of the fieldvalue
- int value to be writtenIOException
public void writeDouble(String fieldName, double value) throws IOException
writeDouble
in interface PortableWriter
fieldName
- name of the fieldvalue
- int value to be writtenIOException
public void writeFloat(String fieldName, float value) throws IOException
writeFloat
in interface PortableWriter
fieldName
- name of the fieldvalue
- int value to be writtenIOException
public void writeShort(String fieldName, short value) throws IOException
writeShort
in interface PortableWriter
fieldName
- name of the fieldvalue
- int value to be writtenIOException
public void writePortable(String fieldName, Portable portable) throws IOException
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
writeByteArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- byte array to be writtenIOException
public void writeCharArray(String fieldName, char[] values) throws IOException
writeCharArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- char array to be writtenIOException
public void writeIntArray(String fieldName, int[] values) throws IOException
writeIntArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- int array to be writtenIOException
public void writeLongArray(String fieldName, long[] values) throws IOException
writeLongArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- long array to be writtenIOException
public void writeDoubleArray(String fieldName, double[] values) throws IOException
writeDoubleArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- double array to be writtenIOException
public void writeFloatArray(String fieldName, float[] values) throws IOException
writeFloatArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- float array to be writtenIOException
public void writeShortArray(String fieldName, short[] values) throws IOException
writeShortArray
in interface PortableWriter
fieldName
- name of the fieldvalues
- short array to be writtenIOException
public void writePortableArray(String fieldName, Portable[] portables) throws IOException
writePortableArray
in interface PortableWriter
fieldName
- name of the fieldportables
- portable array to be writtenIOException
public com.hazelcast.nio.ObjectDataOutput getRawDataOutput() throws IOException
PortableWriter
getRawDataOutput
in interface PortableWriter
IOException
Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.