com.hazelcast.nio.serialization
Interface PortableReader

All Known Implementing Classes:
DefaultPortableReader, MorphingPortableReader

public interface PortableReader

Provides a mean of reading portable fields from a binary in form of java primitives arrays of java primitives , nested portable fields and array of portable fields.


Method Summary
 int getFieldClassId(String fieldName)
           
 Set<String> getFieldNames()
           
 FieldType getFieldType(String fieldName)
           
 ObjectDataInput getRawDataInput()
          PortableWriter.getRawDataOutput().
 int getVersion()
           
 boolean hasField(String fieldName)
           
 boolean readBoolean(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>
P
readPortable(String fieldName)
           
 Portable[] readPortableArray(String fieldName)
           
 short readShort(String fieldName)
           
 short[] readShortArray(String fieldName)
           
 String readUTF(String fieldName)
           
 

Method Detail

getVersion

int getVersion()
Returns:
version global version of portable classes

hasField

boolean hasField(String fieldName)
Parameters:
fieldName - name of the field
Returns:
true if field exist in this class.

getFieldNames

Set<String> getFieldNames()
Returns:
set of field names on this portable class

getFieldType

FieldType getFieldType(String fieldName)
Parameters:
fieldName - name of the field
Returns:
field type of given fieldName

getFieldClassId

int getFieldClassId(String fieldName)
Parameters:
fieldName - name of the field
Returns:
classId of given field

readInt

int readInt(String fieldName)
            throws IOException
Parameters:
fieldName - name of the field
Returns:
the int value read
Throws:
IOException

readLong

long readLong(String fieldName)
              throws IOException
Parameters:
fieldName - name of the field
Returns:
the long value read
Throws:
IOException

readUTF

String readUTF(String fieldName)
               throws IOException
Parameters:
fieldName - name of the field
Returns:
the utf string value read
Throws:
IOException

readBoolean

boolean readBoolean(String fieldName)
                    throws IOException
Parameters:
fieldName - name of the field
Returns:
the boolean value read
Throws:
IOException

readByte

byte readByte(String fieldName)
              throws IOException
Parameters:
fieldName - name of the field
Returns:
the byte value read
Throws:
IOException

readChar

char readChar(String fieldName)
              throws IOException
Parameters:
fieldName - name of the field
Returns:
the char value read
Throws:
IOException

readDouble

double readDouble(String fieldName)
                  throws IOException
Parameters:
fieldName - name of the field
Returns:
the double value read
Throws:
IOException

readFloat

float readFloat(String fieldName)
                throws IOException
Parameters:
fieldName - name of the field
Returns:
the float value read
Throws:
IOException

readShort

short readShort(String fieldName)
                throws IOException
Parameters:
fieldName - name of the field
Returns:
the short value read
Throws:
IOException

readPortable

<P extends Portable> P readPortable(String fieldName)
                                throws IOException
Parameters:
fieldName - name of the field
Returns:
the portable value read
Throws:
IOException

readByteArray

byte[] readByteArray(String fieldName)
                     throws IOException
Parameters:
fieldName - name of the field
Returns:
the byte array value read
Throws:
IOException

readCharArray

char[] readCharArray(String fieldName)
                     throws IOException
Parameters:
fieldName - name of the field
Returns:
the char array value read
Throws:
IOException

readIntArray

int[] readIntArray(String fieldName)
                   throws IOException
Parameters:
fieldName - name of the field
Returns:
the int array value read
Throws:
IOException

readLongArray

long[] readLongArray(String fieldName)
                     throws IOException
Parameters:
fieldName - name of the field
Returns:
the long array value read
Throws:
IOException

readDoubleArray

double[] readDoubleArray(String fieldName)
                         throws IOException
Parameters:
fieldName - name of the field
Returns:
the double array value read
Throws:
IOException

readFloatArray

float[] readFloatArray(String fieldName)
                       throws IOException
Parameters:
fieldName - name of the field
Returns:
the float array value read
Throws:
IOException

readShortArray

short[] readShortArray(String fieldName)
                       throws IOException
Parameters:
fieldName - name of the field
Returns:
the short array value read
Throws:
IOException

readPortableArray

Portable[] readPortableArray(String fieldName)
                             throws IOException
Parameters:
fieldName - name of the field
Returns:
the portabke value read
Throws:
IOException

getRawDataInput

ObjectDataInput getRawDataInput()
                                throws IOException
PortableWriter.getRawDataOutput().

Note that portable fields can not read after getRawDataInput() is called. In case this happens, IOException will be thrown.

Returns:
rawDataInput
Throws:
IOException


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.