org.apache.ignite.plugin.extensions.communication

## Interface MessageReader

All Known Implementing Classes:
  DirectMessageReader

    public interface MessageReader

Communication message reader.

Allows to customize the binary format of communication messages.

### Method Summary

Methods
`boolean` `beforeMessageRead()`
`void` `incrementState()` Increments read state.
`boolean` `isLastRead()` Tells whether last invocation of any of `readXXX(...)`
`BitSet` `readBitSet(String name)` Reads `BitSet`.
`boolean` `readBoolean(String name)` Reads `boolean` value.
`boolean[]` `readBooleanArray(String name)` Reads `boolean` array.
`byte` `readByte(String name)` Reads `byte` value.
`byte[]` `readByteArray(String name)` Reads `byte` array.
`char` `readChar(String name)` Reads `char` value.
`char[]` `readCharArray(String name)` Reads `char` array.
`<C extends Collection<?>> C` `readCollection(String name, MessageCollectionItemType itemType)` Reads collection.
`double` `readDouble(String name)` Reads `double` value.
`double[]` `readDoubleArray(String name)` Reads `double` array.
`float` `readFloat(String name)` Reads `float` value.
`float[]` `readFloatArray(String name)` Reads `float` array.
`IgniteUuid` `readIgniteUuid(String name)` Reads `IgniteUuid`.
`int` `readInt(String name)` Reads `int` value.
`int[]` `readIntArray(String name)` Reads `int` array.
`long` `readLong(String name)` Reads `long` value.
`long[]` `readLongArray(String name)` Reads `long` array.
`<M extends Map<?,?>> M` `readMap(String name, MessageCollectionItemType keyType, MessageCollectionItemType valType, boolean linked)` Reads map.
`<T extends Message> T` `readMessage(String name)` Reads nested message.
`<T> T[]` `readObjectArray(String name, MessageCollectionItemType itemType, Class<T> itemCls)` Reads array of objects.
`short` `readShort(String name)` Reads `short` value.
`short[]` `readShortArray(String name)` Reads `short` array.
`String` `readString(String name)` Reads `String`.
`UUID` `readUuid(String name)` Reads `UUID`.
`void` `setBuffer(ByteBuffer buf)` Sets but buffer to read from.
`int` `state()` Gets current read state.

### Method Detail

#### setBuffer

    void setBuffer(ByteBuffer buf)

Sets but buffer to read from.

Parameters:
  `buf` - Byte buffer.

#### beforeMessageRead

    boolean beforeMessageRead()

#### readByte

    byte readByte(String name)

Reads `byte` value.

Parameters:
  `name` - Field name.
Returns:
  `byte` value.

#### readShort

    short readShort(String name)

Reads `short` value.

Parameters:
  `name` - Field name.
Returns:
  `short` value.

#### readInt

    int readInt(String name)

Reads `int` value.

Parameters:
  `name` - Field name.
Returns:
  `int` value.

#### readLong

    long readLong(String name)

Reads `long` value.

Parameters:
  `name` - Field name.
Returns:
  `long` value.

#### readFloat

    float readFloat(String name)

Reads `float` value.

Parameters:
  `name` - Field name.
Returns:
  `float` value.

#### readDouble

    double readDouble(String name)

Reads `double` value.

Parameters:
  `name` - Field name.
Returns:
  `double` value.

#### readChar

    char readChar(String name)

Reads `char` value.

Parameters:
  `name` - Field name.
Returns:
  `char` value.

#### readBoolean

    boolean readBoolean(String name)

Reads `boolean` value.

Parameters:
  `name` - Field name.
Returns:
  `boolean` value.

#### readByteArray

    byte[] readByteArray(String name)

Reads `byte` array.

Parameters:
  `name` - Field name.
Returns:
  `byte` array.

#### readShortArray

    short[] readShortArray(String name)

Reads `short` array.

Parameters:
  `name` - Field name.
Returns:
  `short` array.

#### readIntArray

    int[] readIntArray(String name)

Reads `int` array.

Parameters:
  `name` - Field name.
Returns:
  `int` array.

#### readLongArray

    long[] readLongArray(String name)

Reads `long` array.

Parameters:
  `name` - Field name.
Returns:
  `long` array.

#### readFloatArray

    float[] readFloatArray(String name)

Reads `float` array.

Parameters:
  `name` - Field name.
Returns:
  `float` array.

#### readDoubleArray

    double[] readDoubleArray(String name)

Reads `double` array.

Parameters:
  `name` - Field name.
Returns:
  `double` array.

#### readCharArray

    char[] readCharArray(String name)

Reads `char` array.

Parameters:
  `name` - Field name.
Returns:
  `char` array.

#### readBooleanArray

    boolean[] readBooleanArray(String name)

Reads `boolean` array.

Parameters:
  `name` - Field name.
Returns:
  `boolean` array.

#### readString

    String readString(String name)

Reads `String`.

Parameters:
  `name` - Field name.
Returns:
  `String`.

#### readBitSet

    BitSet readBitSet(String name)

Reads `BitSet`.

Parameters:
  `name` - Field name.
Returns:
  `BitSet`.

#### readUuid

    UUID readUuid(String name)

Reads `UUID`.

Parameters:
  `name` - Field name.
Returns:
  `UUID`.

#### readIgniteUuid

    IgniteUuid readIgniteUuid(String name)

Reads `IgniteUuid`.

Parameters:
  `name` - Field name.
Returns:
  `IgniteUuid`.

#### readMessage

    <T extends Message> T readMessage(String name)

Reads nested message.

Parameters:
  `name` - Field name.
Returns:
  Message.

#### readObjectArray

    <T> T[] readObjectArray(String name,
                          MessageCollectionItemType itemType,
                          Class<T> itemCls)

Reads array of objects.

Parameters:
  `name` - Field name.
  `itemType` - Array component type.
  `itemCls` - Array component class.
Returns:
  Array of objects.

#### readCollection

    <C extends Collection<?>> C readCollection(String name,
                                             MessageCollectionItemType itemType)

Reads collection.

Parameters:
  `name` - Field name.
  `itemType` - Collection item type.
Returns:
  Collection.

#### readMap

    <M extends Map<?,?>> M readMap(String name,
                                 MessageCollectionItemType keyType,
                                 MessageCollectionItemType valType,
                                 boolean linked)

Reads map.

Parameters:
  `name` - Field name.
  `keyType` - Map key type.
  `valType` - Map value type.
  `linked` - Whether `LinkedHashMap` should be created.
Returns:
  Map.

#### isLastRead

    boolean isLastRead()

Tells whether last invocation of any of `readXXX(...)` methods has fully written the value. `False` is returned if there were not enough remaining bytes in byte buffer.

Returns:
  Whether las value was fully read.

#### state

    int state()

Gets current read state.

Returns:
  Read state.

#### incrementState

    void incrementState()

Increments read state.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.3.0-incubating
Release Date | : July 10 2015