public interface ReadWriteBuf extends ReadBuf
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears (resets) the buffer so that it can be reused.
|
int |
limit()
Defines the size of the message in the buffer.
|
void |
put(byte value)
Write a byte into the buffer at
writePosition(). |
void |
put(byte[] value,
int start,
int length)
Put an array of bytes into the buffer at
writePosition(). |
void |
putBoolean(boolean value)
Put a boolean into the buffer at
writePosition() . |
void |
putDouble(double value)
Write a 64-bit float into the buffer at
writePosition(). |
void |
putFloat(float value)
Write a 32-bit float into the buffer at
writePosition(). |
void |
putInt(int value)
Write a 32-bit into in the buffer at
writePosition(). |
void |
putLong(long value)
Write a 64-bit into in the buffer at
writePosition(). |
void |
putShort(short value)
Write a 16-bit into in the buffer at
writePosition(). |
boolean |
requestCapacity(int capacity)
Request capacity of the buffer.
|
void |
set(int index,
byte value)
Read a byte from data.
|
void |
set(int index,
byte[] value,
int start,
int length)
Write an array of bytes into the buffer.
|
void |
setBoolean(int index,
boolean value)
Write boolean into a given position on the buffer.
|
void |
setDouble(int index,
double value)
Read a 64-bit float from data.
|
void |
setFloat(int index,
float value)
Read a 32-bit float from data.
|
void |
setInt(int index,
int value)
Read a 32-bit int from data.
|
void |
setLong(int index,
long value)
Read a 64-bit long from data.
|
void |
setShort(int index,
short value)
Read a short from data.
|
int |
writePosition() |
void clear()
int limit()
limit() -1.void put(byte value)
writePosition(). Write position will be incremented.void put(byte[] value,
int start,
int length)
writePosition(). Write position will be
incremented.value - the data to be copiedstart - initial position on value to be copiedlength - amount of bytes to be copiedvoid putBoolean(boolean value)
writePosition() . Booleans as stored as single byte.
Write position will be incremented.void putDouble(double value)
writePosition(). Write position will be
incremented.void putFloat(float value)
writePosition(). Write position will be
incremented.void putInt(int value)
writePosition(). Write position will be
incremented.void putLong(long value)
writePosition(). Write position will be
incremented.void putShort(short value)
writePosition(). Write position will be
incremented.boolean requestCapacity(int capacity)
void set(int index,
byte value)
index - position of the element in the buffervoid set(int index,
byte[] value,
int start,
int length)
index - initial position of the buffer to be writtenvalue - the data to be copiedstart - initial position on value to be copiedlength - amount of bytes to be copiedvoid setBoolean(int index,
boolean value)
index - position of the element in buffervoid setDouble(int index,
double value)
index - position of the element in com.google.flatbuffers.ReadBufvoid setFloat(int index,
float value)
index - position of the element in com.google.flatbuffers.ReadBufvoid setInt(int index,
int value)
index - position of the element in com.google.flatbuffers.ReadBufvoid setLong(int index,
long value)
index - position of the element in com.google.flatbuffers.ReadBufvoid setShort(int index,
short value)
index - position of the element in com.google.flatbuffers.ReadBufint writePosition()