Package com.hazelcast.nio.serialization
Interface PortableReader
public interface PortableReader
Provides means for reading portable fields from binary data in the form of java primitives,
arrays of java primitives, nested portable fields and array of portable fields.
-
Method Summary
Modifier and Type Method Description int
getFieldClassId(String fieldName)
Set<String>
getFieldNames()
FieldType
getFieldType(String fieldName)
ObjectDataInput
getRawDataInput()
int
getVersion()
boolean
hasField(String fieldName)
boolean
readBoolean(String fieldName)
boolean[]
readBooleanArray(String fieldName)
byte
readByte(String fieldName)
byte[]
readByteArray(String fieldName)
char
readChar(String fieldName)
char[]
readCharArray(String fieldName)
double
readDouble(String fieldName)
double[]
readDoubleArray(String fieldName)
float
readFloat(String fieldName)
float[]
readFloatArray(String fieldName)
int
readInt(String fieldName)
int[]
readIntArray(String fieldName)
long
readLong(String fieldName)
long[]
readLongArray(String fieldName)
<P extends Portable>
PreadPortable(String fieldName)
Portable[]
readPortableArray(String fieldName)
short
readShort(String fieldName)
short[]
readShortArray(String fieldName)
String
readUTF(String fieldName)
String[]
readUTFArray(String fieldName)
-
Method Details
-
getVersion
int getVersion()- Returns:
- global version of portable classes
-
hasField
- Parameters:
fieldName
- name of the field (does not support nested paths)- Returns:
- true if field exist in this class.
-
getFieldNames
- Returns:
- set of field names on this portable class
-
getFieldType
- Parameters:
fieldName
- name of the field- Returns:
- field type of given fieldName
-
getFieldClassId
- Parameters:
fieldName
- name of the field- Returns:
- classId of given field
-
readInt
- Parameters:
fieldName
- name of the field- Returns:
- the int value read
- Throws:
IOException
- in case of any exceptional case
-
readLong
- Parameters:
fieldName
- name of the field- Returns:
- the long value read
- Throws:
IOException
- in case of any exceptional case
-
readUTF
- Parameters:
fieldName
- name of the field- Returns:
- the utf string value read
- Throws:
IOException
- in case of any exceptional case
-
readBoolean
- Parameters:
fieldName
- name of the field- Returns:
- the boolean value read
- Throws:
IOException
- in case of any exceptional case
-
readByte
- Parameters:
fieldName
- name of the field- Returns:
- the byte value read
- Throws:
IOException
- in case of any exceptional case
-
readChar
- Parameters:
fieldName
- name of the field- Returns:
- the char value read
- Throws:
IOException
- in case of any exceptional case
-
readDouble
- Parameters:
fieldName
- name of the field- Returns:
- the double value read
- Throws:
IOException
- in case of any exceptional case
-
readFloat
- Parameters:
fieldName
- name of the field- Returns:
- the float value read
- Throws:
IOException
- in case of any exceptional case
-
readShort
- Parameters:
fieldName
- name of the field- Returns:
- the short value read
- Throws:
IOException
- in case of any exceptional case
-
readPortable
- Type Parameters:
P
- the type of the portable read- Parameters:
fieldName
- name of the field- Returns:
- the portable value read
- Throws:
IOException
- in case of any exceptional case
-
readByteArray
- Parameters:
fieldName
- name of the field- Returns:
- the byte array value read
- Throws:
IOException
- in case of any exceptional case
-
readBooleanArray
- Parameters:
fieldName
- name of the field- Returns:
- the boolean array value read
- Throws:
IOException
- in case of any exceptional case
-
readCharArray
- Parameters:
fieldName
- name of the field- Returns:
- the char array value read
- Throws:
IOException
- in case of any exceptional case
-
readIntArray
- Parameters:
fieldName
- name of the field- Returns:
- the int array value read
- Throws:
IOException
- in case of any exceptional case
-
readLongArray
- Parameters:
fieldName
- name of the field- Returns:
- the long array value read
- Throws:
IOException
- in case of any exceptional case
-
readDoubleArray
- Parameters:
fieldName
- name of the field- Returns:
- the double array value read
- Throws:
IOException
- in case of any exceptional case
-
readFloatArray
- Parameters:
fieldName
- name of the field- Returns:
- the float array value read
- Throws:
IOException
- in case of any exceptional case
-
readShortArray
- Parameters:
fieldName
- name of the field- Returns:
- the short array value read
- Throws:
IOException
- in case of any exceptional case
-
readUTFArray
- Parameters:
fieldName
- name of the field- Returns:
- the String array value read
- Throws:
IOException
- in case of any exceptional case
-
readPortableArray
- Parameters:
fieldName
- name of the field- Returns:
- the portable value read
- Throws:
IOException
- in case of any exceptional case
-
getRawDataInput
PortableWriter.getRawDataOutput()
.Note that portable fields can not be read after this method is called. If this happens, an IOException will be thrown.
- Returns:
- rawDataInput
- Throws:
IOException
- in case of any exceptional case
-