FlatBuffers
An open source project by FPL.
com.google.flatbuffers.ReadBuf Interface Reference

Represent a chunk of data, where FlexBuffers will read from. More...

Inheritance diagram for com.google.flatbuffers.ReadBuf:
com.google.flatbuffers.ReadWriteBuf com.google.flatbuffers.ArrayReadWriteBuf com.google.flatbuffers.ByteBufferReadWriteBuf

Detailed Description

Represent a chunk of data, where FlexBuffers will read from.

Public Member Functions

byte[] data ()
 Expose ReadBuf as an array of bytes. More...
 
byte get (int index)
 Read a byte from data. More...
 
boolean getBoolean (int index)
 Read boolean from data. More...
 
double getDouble (int index)
 Read a 64-bit float from data. More...
 
float getFloat (int index)
 Read a 32-bit float from data. More...
 
int getInt (int index)
 Read a 32-bit int from data. More...
 
long getLong (int index)
 Read a 64-bit long from data. More...
 
short getShort (int index)
 Read a short from data. More...
 
String getString (int start, int size)
 Read an UTF-8 string from data. More...
 
int limit ()
 Defines the size of the message in the buffer. More...
 

Member Function Documentation

◆ data()

byte [] com.google.flatbuffers.ReadBuf.data ( )

Expose ReadBuf as an array of bytes.

This method is meant to be as efficient as possible, so for a array-backed ReadBuf, it should return its own internal data. In case access to internal data is not possible, a copy of the data into an array of bytes might occur.

Returns
ReadBuf as an array of bytes

Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.

◆ get()

byte com.google.flatbuffers.ReadBuf.get ( int  index)

Read a byte from data.

Parameters
indexposition of the element in ReadBuf
Returns
a byte

Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.

◆ getBoolean()

boolean com.google.flatbuffers.ReadBuf.getBoolean ( int  index)

Read boolean from data.

Booleans as stored as single byte

Parameters
indexposition of the element in ReadBuf
Returns
boolean element

Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.

◆ getDouble()

double com.google.flatbuffers.ReadBuf.getDouble ( int  index)

Read a 64-bit float from data.

Parameters
indexposition of the element in ReadBuf
Returns
a double

Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.

◆ getFloat()

float com.google.flatbuffers.ReadBuf.getFloat ( int  index)

Read a 32-bit float from data.

Parameters
indexposition of the element in ReadBuf
Returns
a float

Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.

◆ getInt()

int com.google.flatbuffers.ReadBuf.getInt ( int  index)

Read a 32-bit int from data.

Parameters
indexposition of the element in ReadBuf
Returns
an int

Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.

◆ getLong()

long com.google.flatbuffers.ReadBuf.getLong ( int  index)

Read a 64-bit long from data.

Parameters
indexposition of the element in ReadBuf
Returns
a long

Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.

◆ getShort()

short com.google.flatbuffers.ReadBuf.getShort ( int  index)

Read a short from data.

Parameters
indexposition of the element in ReadBuf
Returns
a short

Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.

◆ getString()

String com.google.flatbuffers.ReadBuf.getString ( int  start,
int  size 
)

Read an UTF-8 string from data.

Parameters
startinitial element of the string
sizesize of the string in bytes.
Returns
a
String

Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.

◆ limit()

int com.google.flatbuffers.ReadBuf.limit ( )

Defines the size of the message in the buffer.

It also determines last position that buffer can be read. Last byte to be accessed is in position

limit() -1
int limit()
Defines the size of the message in the buffer.

.

Returns
indicate last position

Implemented in com.google.flatbuffers.ReadWriteBuf, com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.


The documentation for this interface was generated from the following file: