Package org.agrona.io

Class DirectBufferDataInput

java.lang.Object
org.agrona.io.DirectBufferDataInput
All Implemented Interfaces:
DataInput

public class DirectBufferDataInput extends Object implements DataInput
A data input implementation that reads from a DirectBuffer. It adheres to the contract defined in DataInput description including throwing checked exception on end of file. It adds few more methods to read strings without allocations.

Note about byte ordering: by default, this class conforms to DataInput contract and uses ByteOrder.BIG_ENDIAN byte order which allows it to read data produced by JDK DataOutput implementations. Agrona buffers use ByteOrder.LITTLE_ENDIAN (unless overridden). Use byteOrder(ByteOrder) method to switch between JDK and Agrona compatibility.