|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compoze.collab.util.HexByteBuffer
public class HexByteBuffer
This class allows the creation of a byte array from primitives, Strings and byte arrays that can be converted to a hex string and back.
Constructor Summary | |
---|---|
HexByteBuffer()
Constructor. |
|
HexByteBuffer(byte[] initial)
Constructor. |
|
HexByteBuffer(String sHex)
Constructor. |
Method Summary | |
---|---|
boolean |
getBoolean()
Gets a boolean. |
byte |
getByte()
Gets a byte. |
byte[] |
getByteArray()
Gets a byte array encoded with a length. |
byte[] |
getBytes(int iLen)
Gets a number of bytes. |
String |
getHexString()
Gets a hex string. |
int |
getInt()
Gets an int. |
long |
getLong()
Gets a long. |
short |
getShort()
Gets a short. |
int |
getSmallInt()
Gets an int that is typically small, encoded in a special way to minimize the number of bytes created. |
String |
getString()
Gets a string. |
static void |
main(String[] args)
Exerciser. |
void |
put(boolean b)
Appends a boolean. |
void |
put(byte b)
Appends a byte. |
void |
put(byte[] bytes)
Appends a byte array to the buffer. |
void |
put(int i)
Appends an integer. |
void |
put(long l)
Appends a long. |
void |
put(short s)
Appends a short. |
void |
put(String s)
Appends a string to the buffer and precedes it with its length. |
void |
putByteArray(byte[] bytes)
Appends a byte array to the buffer and precedes it with its length. |
void |
putHexString(String s)
Appends a string (in hex) to the buffer and precedes it with a length. |
void |
putSmallInt(int i)
Puts an int that is typically small, encoded in a special way to minimize the number of bytes created. |
String |
toString()
Creates a string representation of the byte array in hex. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HexByteBuffer()
public HexByteBuffer(String sHex)
get
methods to be called.
sHex
- a hex string (not null
)public HexByteBuffer(byte[] initial)
get
methods to be called.
initial
- the initial bytes (not null
)Method Detail |
---|
public void putHexString(String s)
s
- a string (not null
)getString()
public void put(String s)
s
- a string (not null
)getString()
public void put(byte[] bytes)
bytes
- the byte array (not null
)getBytes(int)
public void putByteArray(byte[] bytes)
bytes
- the byte array (not null
)public void put(int i)
i
- the intpublic void put(long l)
l
- the longpublic void put(boolean b)
b
- the booleanpublic void put(byte b)
b
- the bytepublic void put(short s)
s
- the shortpublic void putSmallInt(int i)
i
- the intpublic int getSmallInt()
public String getString()
null
)public String getHexString()
null
)public byte[] getBytes(int iLen)
null
)public byte[] getByteArray()
null
)public byte getByte()
public int getInt()
public short getShort()
public long getLong()
public boolean getBoolean()
public String toString()
toString
in class Object
null
)public static void main(String[] args)
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |