FlatBuffers
An open source project by FPL.
|
Implements. More...
Implements.
using an array of bytes as a backing storage. Using array of bytes are usually faster than
.
This class is not thread-safe, meaning that it must operate on a single thread. Operating from multiple thread leads into a undefined behavior
Public Member Functions | |
ArrayReadWriteBuf (byte[] buffer) | |
ArrayReadWriteBuf (byte[] buffer, int startPos) | |
ArrayReadWriteBuf (int initialCapacity) | |
void | clear () |
Clears (resets) the buffer so that it can be reused. More... | |
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... | |
void | put (byte value) |
Write a byte into the buffer at. More... | |
void | put (byte[] value, int start, int length) |
Put an array of bytes into the buffer at. More... | |
void | putBoolean (boolean value) |
Put a boolean into the buffer at. More... | |
void | putDouble (double value) |
Write a 64-bit float into the buffer at. More... | |
void | putFloat (float value) |
Write a 32-bit float into the buffer at. More... | |
void | putInt (int value) |
Write a 32-bit into in the buffer at. More... | |
void | putLong (long value) |
Write a 64-bit into in the buffer at. More... | |
void | putShort (short value) |
Write a 16-bit into in the buffer at. More... | |
boolean | requestCapacity (int capacity) |
Request capacity of the buffer. More... | |
void | set (int index, byte value) |
Read a byte from data. More... | |
void | set (int index, byte[] toCopy, int start, int length) |
Write an array of bytes into the buffer. More... | |
void | setBoolean (int index, boolean value) |
Write boolean into a given position on the buffer. More... | |
void | setDouble (int index, double value) |
Read a 64-bit float from data. More... | |
void | setFloat (int index, float value) |
Read a 32-bit float from data. More... | |
void | setInt (int index, int value) |
Read a 32-bit int from data. More... | |
void | setLong (int index, long value) |
Read a 64-bit long from data. More... | |
void | setShort (int index, short value) |
Read a short from data. More... | |
int | writePosition () |
|
inline |
Clears (resets) the buffer so that it can be reused.
Write position will be set to the start.
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
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.
Implements com.google.flatbuffers.ReadBuf.
|
inline |
Read a byte from data.
index | position of the element in ReadBuf |
Implements com.google.flatbuffers.ReadBuf.
|
inline |
Read boolean from data.
Booleans as stored as single byte
index | position of the element in ReadBuf |
Implements com.google.flatbuffers.ReadBuf.
|
inline |
Read a 64-bit float from data.
index | position of the element in ReadBuf |
Implements com.google.flatbuffers.ReadBuf.
|
inline |
Read a 32-bit float from data.
index | position of the element in ReadBuf |
Implements com.google.flatbuffers.ReadBuf.
|
inline |
Read a 32-bit int from data.
index | position of the element in ReadBuf |
Implements com.google.flatbuffers.ReadBuf.
|
inline |
Read a 64-bit long from data.
index | position of the element in ReadBuf |
Implements com.google.flatbuffers.ReadBuf.
|
inline |
Read a short from data.
index | position of the element in ReadBuf |
Implements com.google.flatbuffers.ReadBuf.
|
inline |
Read an UTF-8 string from data.
start | initial element of the string |
size | size of the string in bytes. |
Implements com.google.flatbuffers.ReadBuf.
|
inline |
Defines the size of the message in the buffer.
It also determines last position that buffer can be read or write. Last byte to be accessed is in position
.
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Write a byte into the buffer at.
. Write position will be incremented.
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Put an array of bytes into the buffer at.
. Write position will be incremented.
value | the data to be copied |
start | initial position on value to be copied |
length | amount of bytes to be copied |
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Put a boolean into the buffer at.
. Booleans as stored as single byte. Write position will be incremented.
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Write a 64-bit float into the buffer at.
. Write position will be incremented.
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Write a 32-bit float into the buffer at.
. Write position will be incremented.
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Write a 32-bit into in the buffer at.
. Write position will be incremented.
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Write a 64-bit into in the buffer at.
. Write position will be incremented.
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Write a 16-bit into in the buffer at.
. Write position will be incremented.
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Request capacity of the buffer.
In case buffer is already larger than the requested, this method will just return true. Otherwise It might try to resize the buffer.
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Read a byte from data.
index | position of the element in the buffer |
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Write an array of bytes into the buffer.
index | initial position of the buffer to be written |
value | the data to be copied |
start | initial position on value to be copied |
length | amount of bytes to be copied |
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Write boolean into a given position on the buffer.
Booleans as stored as single byte.
index | position of the element in buffer |
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Read a 64-bit float from data.
index | position of the element in ReadBuf |
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Read a 32-bit float from data.
index | position of the element in ReadBuf |
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Read a 32-bit int from data.
index | position of the element in ReadBuf |
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Read a 64-bit long from data.
index | position of the element in ReadBuf |
Implements com.google.flatbuffers.ReadWriteBuf.
|
inline |
Read a short from data.
index | position of the element in ReadBuf |
Implements com.google.flatbuffers.ReadWriteBuf.