org.apache.ignite.internal.direct.stream.v2

## Class DirectByteBufferStreamImplV2

- java.lang.Object
- - org.apache.ignite.internal.direct.stream.v2.DirectByteBufferStreamImplV2

All Implemented Interfaces:
  DirectByteBufferStream

Direct Known Subclasses:
  DirectByteBufferStreamImplV3

    public class DirectByteBufferStreamImplV2
    extends Object
    implements DirectByteBufferStream

Direct marshalling I/O stream (version 2).

### Field Summary

Fields
`protected boolean` `lastFinished`

### Constructor Summary

Constructors
Constructor and Description
`DirectByteBufferStreamImplV2(MessageFactory msgFactory)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `lastFinished()`
`protected Object` `read(MessageCollectionItemType type, MessageReader reader)`
`AffinityTopologyVersion` `readAffinityTopologyVersion()`
`BitSet` `readBitSet()`
`boolean` `readBoolean()`
`boolean[]` `readBooleanArray()`
`byte` `readByte()`
`byte[]` `readByteArray()`
`char` `readChar()`
`char[]` `readCharArray()`
`<C extends Collection<?>> C` `readCollection(MessageCollectionItemType itemType, MessageReader reader)`
`double` `readDouble()`
`double[]` `readDoubleArray()`
`float` `readFloat()`
`float[]` `readFloatArray()`
`IgniteUuid` `readIgniteUuid()`
`int` `readInt()`
`int[]` `readIntArray()`
`long` `readLong()`
`long[]` `readLongArray()`
`<M extends Map<?,?>> M` `readMap(MessageCollectionItemType keyType, MessageCollectionItemType valType, boolean linked, MessageReader reader)`
`<T extends Message> T` `readMessage(MessageReader reader)`
`<T> T[]` `readObjectArray(MessageCollectionItemType itemType, Class<T> itemCls, MessageReader reader)`
`short` `readShort()`
`short[]` `readShortArray()`
`String` `readString()`
`UUID` `readUuid()`
`int` `remaining()`
`void` `setBuffer(ByteBuffer buf)`
`String` `toString()`
`protected void` `write(MessageCollectionItemType type, Object val, MessageWriter writer)`
`void` `writeAffinityTopologyVersion(AffinityTopologyVersion val)`
`void` `writeBitSet(BitSet val)`
`void` `writeBoolean(boolean val)`
`void` `writeBooleanArray(boolean[] val)`
`void` `writeByte(byte val)`
`void` `writeByteArray(byte[] val)`
`void` `writeByteArray(byte[] val, long off, int len)`
`void` `writeChar(char val)`
`void` `writeCharArray(char[] val)`
`<T> void` `writeCollection(Collection<T> col, MessageCollectionItemType itemType, MessageWriter writer)`
`void` `writeDouble(double val)`
`void` `writeDoubleArray(double[] val)`
`void` `writeFloat(float val)`
`void` `writeFloatArray(float[] val)`
`void` `writeIgniteUuid(IgniteUuid val)`
`void` `writeInt(int val)`
`void` `writeIntArray(int[] val)`
`void` `writeLong(long val)`
`void` `writeLongArray(long[] val)`
`void` `writeLongArray(long[] val, int len)`
`<K,V> void` `writeMap(Map<K,V> map, MessageCollectionItemType keyType, MessageCollectionItemType valType, MessageWriter writer)`
`void` `writeMessage(Message msg, MessageWriter writer)`
`<T> void` `writeObjectArray(T[] arr, MessageCollectionItemType itemType, MessageWriter writer)`
`void` `writeShort(short val)`
`void` `writeShortArray(short[] val)`
`void` `writeString(String val)`
`void` `writeUuid(UUID val)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### lastFinished

    protected boolean lastFinished

### Constructor Detail

#### DirectByteBufferStreamImplV2

    public DirectByteBufferStreamImplV2(MessageFactory msgFactory)

Parameters:
  `msgFactory` - Message factory.

### Method Detail

#### setBuffer

    public void setBuffer(ByteBuffer buf)

Specified by:
  `setBuffer` in interface `DirectByteBufferStream`
Parameters:
  `buf` - Buffer.

#### remaining

    public int remaining()

Specified by:
  `remaining` in interface `DirectByteBufferStream`
Returns:
  Number of remaining bytes.

#### lastFinished

    public boolean lastFinished()

Specified by:
  `lastFinished` in interface `DirectByteBufferStream`
Returns:
  Whether last object was fully written or read.

#### writeByte

    public void writeByte(byte val)

Specified by:
  `writeByte` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeShort

    public void writeShort(short val)

Specified by:
  `writeShort` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeInt

    public void writeInt(int val)

Specified by:
  `writeInt` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeLong

    public void writeLong(long val)

Specified by:
  `writeLong` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeFloat

    public void writeFloat(float val)

Specified by:
  `writeFloat` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeDouble

    public void writeDouble(double val)

Specified by:
  `writeDouble` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeChar

    public void writeChar(char val)

Specified by:
  `writeChar` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeBoolean

    public void writeBoolean(boolean val)

Specified by:
  `writeBoolean` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeByteArray

    public void writeByteArray(byte[] val)

Specified by:
  `writeByteArray` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeByteArray

    public void writeByteArray(byte[] val,
                               long off,
                               int len)

Specified by:
  `writeByteArray` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.
  `off` - Offset.
  `len` - Length.

#### writeShortArray

    public void writeShortArray(short[] val)

Specified by:
  `writeShortArray` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeIntArray

    public void writeIntArray(int[] val)

Specified by:
  `writeIntArray` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeLongArray

    public void writeLongArray(long[] val)

Specified by:
  `writeLongArray` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeLongArray

    public void writeLongArray(long[] val,
                               int len)

Specified by:
  `writeLongArray` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.
  `len` - Length.

#### writeFloatArray

    public void writeFloatArray(float[] val)

Specified by:
  `writeFloatArray` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeDoubleArray

    public void writeDoubleArray(double[] val)

Specified by:
  `writeDoubleArray` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeCharArray

    public void writeCharArray(char[] val)

Specified by:
  `writeCharArray` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeBooleanArray

    public void writeBooleanArray(boolean[] val)

Specified by:
  `writeBooleanArray` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeString

    public void writeString(String val)

Specified by:
  `writeString` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeBitSet

    public void writeBitSet(BitSet val)

Specified by:
  `writeBitSet` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeUuid

    public void writeUuid(UUID val)

Specified by:
  `writeUuid` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeIgniteUuid

    public void writeIgniteUuid(IgniteUuid val)

Specified by:
  `writeIgniteUuid` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeAffinityTopologyVersion

    public void writeAffinityTopologyVersion(AffinityTopologyVersion val)

Specified by:
  `writeAffinityTopologyVersion` in interface `DirectByteBufferStream`
Parameters:
  `val` - Value.

#### writeMessage

    public void writeMessage(Message msg,
                             MessageWriter writer)

Specified by:
  `writeMessage` in interface `DirectByteBufferStream`
Parameters:
  `msg` - Message.
  `writer` - Writer.

#### writeObjectArray

    public <T> void writeObjectArray(T[] arr,
                                     MessageCollectionItemType itemType,
                                     MessageWriter writer)

Specified by:
  `writeObjectArray` in interface `DirectByteBufferStream`
Parameters:
  `arr` - Array.
  `itemType` - Component type.
  `writer` - Writer.

#### writeCollection

    public <T> void writeCollection(Collection<T> col,
                                    MessageCollectionItemType itemType,
                                    MessageWriter writer)

Specified by:
  `writeCollection` in interface `DirectByteBufferStream`
Parameters:
  `col` - Collection.
  `itemType` - Component type.
  `writer` - Writer.

#### writeMap

    public <K,V> void writeMap(Map<K,V> map,
                               MessageCollectionItemType keyType,
                               MessageCollectionItemType valType,
                               MessageWriter writer)

Specified by:
  `writeMap` in interface `DirectByteBufferStream`
Parameters:
  `map` - Map.
  `keyType` - Key type.
  `valType` - Value type.
  `writer` - Writer.

#### readByte

    public byte readByte()

Specified by:
  `readByte` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readShort

    public short readShort()

Specified by:
  `readShort` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readInt

    public int readInt()

Specified by:
  `readInt` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readLong

    public long readLong()

Specified by:
  `readLong` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readFloat

    public float readFloat()

Specified by:
  `readFloat` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readDouble

    public double readDouble()

Specified by:
  `readDouble` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readChar

    public char readChar()

Specified by:
  `readChar` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readBoolean

    public boolean readBoolean()

Specified by:
  `readBoolean` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readByteArray

    public byte[] readByteArray()

Specified by:
  `readByteArray` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readShortArray

    public short[] readShortArray()

Specified by:
  `readShortArray` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readIntArray

    public int[] readIntArray()

Specified by:
  `readIntArray` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readLongArray

    public long[] readLongArray()

Specified by:
  `readLongArray` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readFloatArray

    public float[] readFloatArray()

Specified by:
  `readFloatArray` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readDoubleArray

    public double[] readDoubleArray()

Specified by:
  `readDoubleArray` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readCharArray

    public char[] readCharArray()

Specified by:
  `readCharArray` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readBooleanArray

    public boolean[] readBooleanArray()

Specified by:
  `readBooleanArray` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readString

    public String readString()

Specified by:
  `readString` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readBitSet

    public BitSet readBitSet()

Specified by:
  `readBitSet` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readUuid

    public UUID readUuid()

Specified by:
  `readUuid` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readIgniteUuid

    public IgniteUuid readIgniteUuid()

Specified by:
  `readIgniteUuid` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readAffinityTopologyVersion

    public AffinityTopologyVersion readAffinityTopologyVersion()

Specified by:
  `readAffinityTopologyVersion` in interface `DirectByteBufferStream`
Returns:
  Value.

#### readMessage

    public <T extends Message> T readMessage(MessageReader reader)

Specified by:
  `readMessage` in interface `DirectByteBufferStream`
Parameters:
  `reader` - Reader.
Returns:
  Message.

#### readObjectArray

    public <T> T[] readObjectArray(MessageCollectionItemType itemType,
                                   Class<T> itemCls,
                                   MessageReader reader)

Specified by:
  `readObjectArray` in interface `DirectByteBufferStream`
Parameters:
  `itemType` - Item type.
  `itemCls` - Item class.
  `reader` - Reader.
Returns:
  Array.

#### readCollection

    public <C extends Collection<?>> C readCollection(MessageCollectionItemType itemType,
                                                      MessageReader reader)

Specified by:
  `readCollection` in interface `DirectByteBufferStream`
Parameters:
  `itemType` - Item type.
  `reader` - Reader.
Returns:
  Collection.

#### readMap

    public <M extends Map<?,?>> M readMap(MessageCollectionItemType keyType,
                                          MessageCollectionItemType valType,
                                          boolean linked,
                                          MessageReader reader)

Specified by:
  `readMap` in interface `DirectByteBufferStream`
Parameters:
  `keyType` - Key type.
  `valType` - Value type.
  `linked` - Whether linked map should be created.
  `reader` - Reader.
Returns:
  Map.

#### write

    protected void write(MessageCollectionItemType type,
                         Object val,
                         MessageWriter writer)

Parameters:
  `type` - Type.
  `val` - Value.
  `writer` - Writer.

#### read

    protected Object read(MessageCollectionItemType type,
                          MessageReader reader)

Parameters:
  `type` - Type.
  `reader` - Reader.
Returns:
  Value.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.14.0
Release Date | : September 29 2022