| Modifier and Type | Field and Description |
|---|---|
protected java.nio.ByteBuffer |
buffer
Byte buffer to store data
|
static int |
BUFFER_LENGTH
Size of the buffer
|
messageHeader, size| Constructor and Description |
|---|
BufferRaw()
Default constructor
|
BufferRaw(MessageHeader messageHeader)
Constructor with given values
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
array() |
MessageHeader |
extractHeader()
Retrieve the message header from the buffer
|
byte |
get()
Retrieve a byte from the buffer
|
boolean |
getBoolean()
Retrieve a boolean from the buffer
|
boolean[] |
getBooleanArray(int length)
Retrieve a boolean array from the buffer
|
byte[] |
getByteArray(int length)
Retrieve a byte array from the buffer
|
char |
getChar()
Retrieve a char from the buffer
|
char[] |
getCharArray(int length)
Retrieve a char array from the buffer
|
double |
getDouble()
Retrieve a double from the buffer
|
double[] |
getDoubleArray(int length)
Retrieve a double array from the buffer
|
float |
getFloat()
Retrieve a float from the buffer
|
float[] |
getFloatArray(int length)
Retrieve a float array from the buffer
|
int |
getInt()
Retrieve a int from the buffer
|
int |
getInt(int index)
Get int value at the specified index
|
int[] |
getIntArray(int length)
Retrieve a int array from the buffer
|
long |
getLong()
Retrieve a long from the buffer
|
long[] |
getLongArray(int length)
Retrieve a long array from the buffer
|
short |
getShort()
Retrieve a short from the buffer
|
short[] |
getShortArray(int length)
Retrieve a short array from the buffer
|
java.lang.String |
getString()
Retrieve a string from the buffer
|
int |
getTranslatedInteger(byte[] value)
Get a integer value of the byte array
|
protected int |
limit()
Return the buffer's limit
|
int |
packMessageHeader()
Format: Size Type (0, 1, 2) (response, request, exeption)
|
int |
position()
Get the current buffer's position
|
void |
position(int index)
Set the pointer to the index
|
void |
put(byte value)
Insert a byte in the buffer
|
void |
put(byte[] data)
Insert a byte array into the buffer
|
void |
put(byte[] data,
int offset,
int length)
Insert a byte array into a specific place in the buffer
|
void |
putBoolean(boolean value)
Insert a boolean in the buffer
|
void |
putBooleanArray(boolean[] value)
Insert a boolean array into the buffer
|
void |
putByteArray(byte[] value)
Insert a byte array into the buffer
|
void |
putChar(char value)
Insert a char into the buffer
|
void |
putCharArray(char[] value)
Insert a char array into the buffer
|
void |
putDouble(double value)
Insert a double value into the buffer
|
void |
putDoubleArray(double[] value)
Insert a double array into the buffer
|
void |
putFloat(float value)
Insert a float value into the buffer
|
void |
putFloatArray(float[] value)
Insert a float array into the buffer
|
void |
putInt(int value)
Insert a int into the buffer
|
void |
putInt(int index,
int value)
Insert int value at a specified index in the buffer
|
void |
putIntArray(int[] value)
Insert a int array into the buffer
|
void |
putLong(long value)
Insert a long into the buffer
|
void |
putLongArray(long[] value)
Insert a long array into the buffer
|
void |
putShort(short value)
Insert a short into the buffer
|
void |
putShortArray(short[] value)
Insert a short array into the buffer
|
void |
putString(java.lang.String data)
Insert a string into the buffer
|
void |
reset()
Erase the buffer and set the pointer to the beginning
|
void |
resetToReceive()
Reset the buffer before reception of a new message
|
void |
resize(int moreCapacity)
Resize the current buffer to store more data
|
void |
resize(int position,
int moreCapacity) |
java.lang.String |
toCharString()
Return an empty string
|
java.lang.String |
toIntString()
Return an empty string
|
checkAndThrow, deserializeReferenceObject, getArray, getHeader, getValue, getValue, putArray, putValue, serializeReferenceObject, setHeader, sizepublic static final int BUFFER_LENGTH
protected java.nio.ByteBuffer buffer
public BufferRaw()
public BufferRaw(MessageHeader messageHeader)
messageHeader - Message header to be associated with this bufferpublic MessageHeader extractHeader()
POPBufferextractHeader in class POPBufferpublic int packMessageHeader()
packMessageHeader in class POPBufferpublic boolean getBoolean()
POPBuffergetBoolean in class POPBufferpublic float getFloat()
POPBufferpublic int getInt()
POPBufferpublic int getInt(int index)
index - index of the valuepublic char getChar()
POPBufferpublic double getDouble()
POPBufferpublic long getLong()
POPBufferpublic java.lang.String getString()
POPBufferpublic void put(byte value)
POPBufferpublic void put(byte[] data)
POPBufferpublic void put(byte[] data,
int offset,
int length)
POPBufferpublic void putBoolean(boolean value)
POPBufferputBoolean in class POPBuffervalue - boolean value to insertpublic void putChar(char value)
POPBufferpublic void putFloat(float value)
POPBufferpublic void putInt(int value)
POPBufferpublic void putInt(int index,
int value)
index - index to put the valuevalue - the int value to be insertedpublic void putDouble(double value)
POPBufferpublic void putLong(long value)
POPBufferpublic void putString(java.lang.String data)
POPBufferpublic void reset()
POPBufferpublic void resetToReceive()
POPBufferresetToReceive in class POPBufferpublic int getTranslatedInteger(byte[] value)
POPBuffergetTranslatedInteger in class POPBuffervalue - The byte array to translatepublic java.lang.String toIntString()
POPBuffertoIntString in class POPBufferpublic java.lang.String toCharString()
POPBuffertoCharString in class POPBufferpublic int position()
public void position(int index)
index - index to set the pointerprotected int limit()
public void resize(int moreCapacity)
moreCapacity - The additional capacity to add on the current bufferpublic void resize(int position,
int moreCapacity)
public void putBooleanArray(boolean[] value)
POPBufferputBooleanArray in class POPBuffervalue - boolean array to insertpublic void putDoubleArray(double[] value)
POPBufferputDoubleArray in class POPBuffervalue - double array to insertpublic void putFloatArray(float[] value)
POPBufferputFloatArray in class POPBuffervalue - float array to insertpublic void putIntArray(int[] value)
POPBufferputIntArray in class POPBuffervalue - int array to insertpublic void putLongArray(long[] value)
POPBufferputLongArray in class POPBuffervalue - long array to insertpublic byte get()
POPBufferpublic boolean[] getBooleanArray(int length)
POPBuffergetBooleanArray in class POPBufferlength - length of the array to retrievepublic byte[] getByteArray(int length)
POPBuffergetByteArray in class POPBufferlength - length of the array to retrievepublic double[] getDoubleArray(int length)
POPBuffergetDoubleArray in class POPBufferlength - length of the array to retrievepublic float[] getFloatArray(int length)
POPBuffergetFloatArray in class POPBufferlength - length of the array to retrievepublic int[] getIntArray(int length)
POPBuffergetIntArray in class POPBufferlength - length of the array to retrievepublic long[] getLongArray(int length)
POPBuffergetLongArray in class POPBufferlength - length of the array to retrievepublic void putByteArray(byte[] value)
POPBufferputByteArray in class POPBuffervalue - byte array to insertpublic short getShort()
POPBufferpublic void putShort(short value)
POPBufferpublic short[] getShortArray(int length)
POPBuffergetShortArray in class POPBufferlength - length of the array to retrievepublic void putShortArray(short[] value)
POPBufferputShortArray in class POPBuffervalue - short array to insertpublic char[] getCharArray(int length)
POPBuffergetCharArray in class POPBufferlength - length of the array to retrievepublic void putCharArray(char[] value)
POPBufferputCharArray in class POPBuffervalue - char array to insert