|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectutils.OctetBuffer
public class OctetBuffer
Encapsulates binary payload that can be manipulated on the octet (byte) level.
Field Summary | |
---|---|
private int |
position
Position index |
private int |
sliceOffset
Offset into backing store to enable slicing |
private byte[] |
store
The octet storage |
Constructor Summary | |
---|---|
OctetBuffer()
|
Method Summary | |
---|---|
static OctetBuffer |
allocate(int size)
Allocates buffer |
byte |
get()
Gets primitive 'byte' from the slice offset in the store |
void |
get(byte[] array)
Gets byte[] array from the slice offset in the store |
char |
getChar()
Gets primitive 'char' from the slice offset in the store |
char |
getChar(int offset)
Gets primitive 'char' from the slice offset in the store |
int |
getFreeSpace()
Returns remaining space |
int |
getInt()
Gets primitive 'int' from the slice offset in the store |
int |
getPosition()
Gets current position |
short |
getShort()
Gets primitive 'short' from the slice offset in the store |
short |
getShort(int offset)
Gets primitive 'short' from the offset in the store |
byte[] |
getStore()
Returns internal byte[] store |
int |
getStoreSize()
Returns internal byte[] store |
boolean |
hasFreeSpace()
Returns true if there is free space in the store |
void |
put(byte value)
Puts primitive 'byte' from the slice offset in the store |
void |
put(byte[] array)
Puts byte[] array at the slice offset in the store |
void |
putChar(char value)
Puts primitive 'char' at the slice offset in the store |
void |
putChar(int offset,
char value)
Puts primitive 'char' at the slice offset in the store |
void |
putInt(int value)
Puts primitive 'int' at the slice offset in the store |
void |
putShort(int offset,
short value)
Puts primitive 'short' at the slice offset in the store |
void |
putShort(short value)
Puts primitive 'short' at the slice offset in the store |
OctetBuffer |
slice()
Slices buffer |
static int |
toInt(byte b)
Converts a 'byte' to an 'int'. |
static OctetBuffer |
wrap(byte[] bs)
Wraps existing byte[] array |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private byte[] store
private int position
private int sliceOffset
Constructor Detail |
---|
public OctetBuffer()
Method Detail |
---|
public static OctetBuffer allocate(int size)
public static OctetBuffer wrap(byte[] bs)
public OctetBuffer slice()
public byte[] getStore()
public int getStoreSize()
public int getPosition()
public int getFreeSpace()
public boolean hasFreeSpace()
public short getShort()
public short getShort(int offset)
public void putShort(short value)
public void putShort(int offset, short value)
public int getInt()
public void putInt(int value)
public byte get()
public void put(byte value)
public void put(byte[] array)
public void get(byte[] array)
public void putChar(char value)
public void putChar(int offset, char value)
public char getChar()
public char getChar(int offset)
public static int toInt(byte b)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |