FlatBuffers
An open source project by FPL.
|
Represent a chunk of data, where FlexBuffers will read from. More...
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... | |
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.
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
byte com.google.flatbuffers.ReadBuf.get | ( | int | index | ) |
Read a byte from data.
index | position of the element in ReadBuf |
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
boolean com.google.flatbuffers.ReadBuf.getBoolean | ( | int | index | ) |
Read boolean from data.
Booleans as stored as single byte
index | position of the element in ReadBuf |
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
double com.google.flatbuffers.ReadBuf.getDouble | ( | int | index | ) |
Read a 64-bit float from data.
index | position of the element in ReadBuf |
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
float com.google.flatbuffers.ReadBuf.getFloat | ( | int | index | ) |
Read a 32-bit float from data.
index | position of the element in ReadBuf |
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
int com.google.flatbuffers.ReadBuf.getInt | ( | int | index | ) |
Read a 32-bit int from data.
index | position of the element in ReadBuf |
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
long com.google.flatbuffers.ReadBuf.getLong | ( | int | index | ) |
Read a 64-bit long from data.
index | position of the element in ReadBuf |
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
short com.google.flatbuffers.ReadBuf.getShort | ( | int | index | ) |
Read a short from data.
index | position of the element in ReadBuf |
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
String com.google.flatbuffers.ReadBuf.getString | ( | int | start, |
int | size | ||
) |
Read an UTF-8 string from data.
start | initial element of the string |
size | size of the string in bytes. |
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
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
.
Implemented in com.google.flatbuffers.ReadWriteBuf, com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.