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)
LocalDate
readDate(String fieldName)
Reads a date field consisting of year, month of the year and day of the month to LocalDateLocalDate[]
readDateArray(String fieldName)
Reads an array of Date's to LocalDate[]BigDecimal
readDecimal(String fieldName)
Reads a decimal which is arbitrary precision and scale floating-point number to BigDecimalBigDecimal[]
readDecimalArray(String fieldName)
Reads an array of Decimal's to BigDecimal[]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
readString(String fieldName)
String[]
readStringArray(String fieldName)
LocalTime
readTime(String fieldName)
Reads a time field consisting of hour, minute, seconds and nanos parts to LocalTimeLocalTime[]
readTimeArray(String fieldName)
Reads an array of Time's to LocalTime[]LocalDateTime
readTimestamp(String fieldName)
Reads a timestamp field consisting of year, month of the year, day of the month, hour, minute, seconds, nanos parts to LocalDateTimeLocalDateTime[]
readTimestampArray(String fieldName)
Reads an array of Timestamp's to LocalDateTime[]OffsetDateTime
readTimestampWithTimezone(String fieldName)
Reads a timestamp with timezone field consisting of year, month of the year, day of the month, offset seconds, hour, minute, seconds, nanos parts to OffsetDateTimeOffsetDateTime[]
readTimestampWithTimezoneArray(String fieldName)
Reads an array of TimestampWithTimezone's to OffsetDateTime[]String
readUTF(String fieldName)
Deprecated.for the sake of better naming.String[]
readUTFArray(String fieldName)
Deprecated.for the sake of better naming.
-
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
- Throws:
IllegalArgumentException
- if the field does not exist.
-
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
Deprecated.for the sake of better naming. UsereadString(String)
instead- Parameters:
fieldName
- name of the field- Returns:
- the utf string value read
- Throws:
IOException
- in case of any exceptional case
-
readString
- Parameters:
fieldName
- name of the field- Returns:
- the 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
-
readDecimal
Reads a decimal which is arbitrary precision and scale floating-point number to BigDecimal- Parameters:
fieldName
- name of the field- Returns:
- the BigDecimal value read
- Throws:
IOException
- in case of any exceptional case
-
readTime
Reads a time field consisting of hour, minute, seconds and nanos parts to LocalTime- Parameters:
fieldName
- name of the field- Returns:
- the LocalTime value read
- Throws:
IOException
- in case of any exceptional case
-
readDate
Reads a date field consisting of year, month of the year and day of the month to LocalDate- Parameters:
fieldName
- name of the field- Returns:
- the LocalDate value read
- Throws:
IOException
- in case of any exceptional case
-
readTimestamp
Reads a timestamp field consisting of year, month of the year, day of the month, hour, minute, seconds, nanos parts to LocalDateTime- Parameters:
fieldName
- name of the field- Returns:
- the LocalDateTime value read
- Throws:
IOException
- in case of any exceptional case
-
readTimestampWithTimezone
Reads a timestamp with timezone field consisting of year, month of the year, day of the month, offset seconds, hour, minute, seconds, nanos parts to OffsetDateTime- Parameters:
fieldName
- name of the field- Returns:
- the OffsetDateTime 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
Deprecated.for the sake of better naming. UsereadStringArray(String)
instead- Parameters:
fieldName
- name of the field- Returns:
- the String array value read
- Throws:
IOException
- in case of any exceptional case
-
readStringArray
- 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 array read
- Throws:
IOException
- in case of any exceptional case
-
readDecimalArray
Reads an array of Decimal's to BigDecimal[]- Parameters:
fieldName
- name of the field- Returns:
- the BigDecimal array read
- Throws:
IOException
- in case of any exceptional case- See Also:
readDecimal(String)
-
readTimeArray
Reads an array of Time's to LocalTime[]- Parameters:
fieldName
- name of the field- Returns:
- the LocalTime array read
- Throws:
IOException
- in case of any exceptional case- See Also:
readTime(String)
-
readDateArray
Reads an array of Date's to LocalDate[]- Parameters:
fieldName
- name of the field- Returns:
- the LocalDate array read
- Throws:
IOException
- in case of any exceptional case- See Also:
readDate(String)
-
readTimestampArray
Reads an array of Timestamp's to LocalDateTime[]- Parameters:
fieldName
- name of the field- Returns:
- the LocalDateTime array read
- Throws:
IOException
- in case of any exceptional case- See Also:
readTimestamp(String)
-
readTimestampWithTimezoneArray
@Nullable OffsetDateTime[] readTimestampWithTimezoneArray(@Nonnull String fieldName) throws IOExceptionReads an array of TimestampWithTimezone's to OffsetDateTime[]- Parameters:
fieldName
- name of the field- Returns:
- the OffsetDateTime array read
- Throws:
IOException
- in case of any exceptional case- See Also:
readTimestampWithTimezone(String)
-
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
-