|
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.ByteBuffer
public class ByteBuffer
This is a utility class to write bytes into a buffer taking into account endianess.
Constructor Summary | |
---|---|
ByteBuffer(boolean bLittleEndian)
Constructs a buffer for writing. |
|
ByteBuffer(boolean bLittleEndian,
int iLength)
Constructs a buffer for writing. |
|
ByteBuffer(byte[] bytes)
Constructs a buffer for reading. |
|
ByteBuffer(int iLength)
Constructs a buffer for writing. |
Method Summary | |
---|---|
byte[] |
getBytes()
Gets the bytes for the buffer. |
static void |
main(String[] args)
Exerciser |
byte |
readByte(int iOffset)
Gets a byte from the offset of the byte array. |
byte[] |
readBytes(int iOffset,
int iLen)
Gets a series of bytes from the byte array |
int |
readInt(int iOffset,
boolean bLittleEndian)
Gets an integer from the offset of the byte array. |
long |
readLong(int iOffset,
boolean bLittleEndian)
Gets a long from the offset of the byte array. |
short |
readShort(int iOffset,
boolean bLittleEndian)
Gets a short from the offset of the byte array. |
int |
readShortAsInt(int iOffset,
boolean bLittleEndian)
Gets a short from the offset of the byte array. |
void |
writeByte(byte yValue)
Writes a byte to the buffer |
void |
writeBytes(byte[] yBytes)
Writes a series of bytes, in order. |
void |
writeInt(int iValue)
Writes an integer to the buffer |
void |
writeLong(long lValue)
Writes a long to the buffer |
void |
writeShort(short shValue)
Writes a short to the buffer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ByteBuffer(boolean bLittleEndian)
bLittleEndian
- true
if the data should be
written in little-endian order, false
for big endianpublic ByteBuffer(int iLength)
iLength
- the initial size of the buffer
written in little-endian order, false
for big endianpublic ByteBuffer(boolean bLittleEndian, int iLength)
bLittleEndian
- true
if the data should be
written in little-endian order, false
for big endianpublic ByteBuffer(byte[] bytes)
Method Detail |
---|
public byte[] getBytes()
public void writeInt(int iValue)
iValue
- the integer valuepublic void writeLong(long lValue)
iValue
- the integer valuepublic void writeByte(byte yValue)
public void writeShort(short shValue)
iValue
- the integer valuepublic int readInt(int iOffset, boolean bLittleEndian)
public long readLong(int iOffset, boolean bLittleEndian)
public short readShort(int iOffset, boolean bLittleEndian)
public int readShortAsInt(int iOffset, boolean bLittleEndian)
public byte readByte(int iOffset)
public byte[] readBytes(int iOffset, int iLen)
public void writeBytes(byte[] yBytes)
yBytes
- the bytespublic 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 |