FlatBuffers
An open source project by FPL.
|
Interface to represent a read-write buffer. More...
Interface to represent a read-write buffer.
This interface will be used to access and write FlexBuffers message.
Public Member Functions | |
void | clear () |
Clears (resets) the buffer so that it can be reused. 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[] value, 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 () |
Public Member Functions inherited from com.google.flatbuffers.ReadBuf | |
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... | |
void com.google.flatbuffers.ReadWriteBuf.clear | ( | ) |
Clears (resets) the buffer so that it can be reused.
Write position will be set to the start.
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
int com.google.flatbuffers.ReadWriteBuf.limit | ( | ) |
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.ReadBuf.
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
void com.google.flatbuffers.ReadWriteBuf.put | ( | byte | value | ) |
Write a byte into the buffer at.
. Write position will be incremented.
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
void com.google.flatbuffers.ReadWriteBuf.put | ( | byte[] | value, |
int | start, | ||
int | length | ||
) |
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 |
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
void com.google.flatbuffers.ReadWriteBuf.putBoolean | ( | boolean | value | ) |
Put a boolean into the buffer at.
. Booleans as stored as single byte. Write position will be incremented.
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
void com.google.flatbuffers.ReadWriteBuf.putDouble | ( | double | value | ) |
Write a 64-bit float into the buffer at.
. Write position will be incremented.
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
void com.google.flatbuffers.ReadWriteBuf.putFloat | ( | float | value | ) |
Write a 32-bit float into the buffer at.
. Write position will be incremented.
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
void com.google.flatbuffers.ReadWriteBuf.putInt | ( | int | value | ) |
Write a 32-bit into in the buffer at.
. Write position will be incremented.
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
void com.google.flatbuffers.ReadWriteBuf.putLong | ( | long | value | ) |
Write a 64-bit into in the buffer at.
. Write position will be incremented.
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
void com.google.flatbuffers.ReadWriteBuf.putShort | ( | short | value | ) |
Write a 16-bit into in the buffer at.
. Write position will be incremented.
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
boolean com.google.flatbuffers.ReadWriteBuf.requestCapacity | ( | int | capacity | ) |
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.
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
void com.google.flatbuffers.ReadWriteBuf.set | ( | int | index, |
byte | value | ||
) |
Read a byte from data.
index | position of the element in the buffer |
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
void com.google.flatbuffers.ReadWriteBuf.set | ( | int | index, |
byte[] | value, | ||
int | start, | ||
int | length | ||
) |
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 |
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
void com.google.flatbuffers.ReadWriteBuf.setBoolean | ( | int | index, |
boolean | value | ||
) |
Write boolean into a given position on the buffer.
Booleans as stored as single byte.
index | position of the element in buffer |
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.
void com.google.flatbuffers.ReadWriteBuf.setDouble | ( | int | index, |
double | value | ||
) |
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.
void com.google.flatbuffers.ReadWriteBuf.setFloat | ( | int | index, |
float | value | ||
) |
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.
void com.google.flatbuffers.ReadWriteBuf.setInt | ( | int | index, |
int | value | ||
) |
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.
void com.google.flatbuffers.ReadWriteBuf.setLong | ( | int | index, |
long | value | ||
) |
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.
void com.google.flatbuffers.ReadWriteBuf.setShort | ( | int | index, |
short | value | ||
) |
Read a short from data.
index | position of the element in ReadBuf |
Implemented in com.google.flatbuffers.ByteBufferReadWriteBuf, and com.google.flatbuffers.ArrayReadWriteBuf.