|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectist.palcom.base.Object
ist.palcom.base.ByteBuffer
public class ByteBuffer
ByteBuffer supplies a stream-like interface to manipulating byte-data. This class is an abstract superclass that has two implementations: ByteArrayBuffer and MemoryByteBuffer, that uses a ByteArray and Memory object as storage respectively.
| Constructor Summary | |
|---|---|
ByteBuffer()
|
|
| Method Summary | |
|---|---|
int |
at(int pos)
Returns element at specified position relative offset in this ByteBuffer. |
void |
clear()
Makes this ByteBuffer ready for a new sequence of channel-read or relative put operations: It sets the limit to the capacity and the position to zero. |
void |
flip()
Makes this ByteBuffer ready for a new sequence of channel-write or relative get operations: It sets the limit to the current position and then sets the position to zero. |
int |
get()
Returns the next byte value at current position, and increment position. |
int |
getInt()
Reads an int value (4 bytes) from current position; increments position. |
int |
getIntAt(int pos)
Reads an int value (4 bytes) from specified position-relative offset. |
int |
getShort()
Reads a short value (2 bytes) from current position. |
int |
getShortAt(int pos)
Reads a short value (2 bytes) from specified position-relative offset. |
boolean |
hasRemaining()
Tests if this buffer as remaining data. |
void |
init()
Initializes this ByteBuffer. |
boolean |
isLittleEndian()
Returns true if data in this ByteBuffer is stored in little endian format. |
int |
length()
Returns the number of bytes in this ByteBuffer |
limit |
limit()
Return the limit, which is the number of bytes that can be accessed in this ByteBuffer. |
void |
limit(int lim)
Sets the limit for how much data can be written or read in this ByteBuffer. |
in |
position()
Returns the position of the read/write marker in this ByteBuffer. |
void |
position(int pos)
Sets the position of the read/write marker to the specified value. |
void |
put(int value)
Puts value at current position; increment position. |
void |
putInt(int val)
Writes an int value (4 bytes) to current position; increments position. |
void |
putInt(int val,
int pos)
Writes an int value (4 bytes) to specified position-relative offset. |
void |
putShort(int val)
Writes a short value (2 bytes) a current position, increments position. |
void |
putShort(int val,
int pos)
Writes a short value (2 bytes) a specified position-relative offset. |
int |
remaining()
Returns the number of bytes remaining in this ByteBuffer. |
void |
rewind()
Makes this ByteBuffer ready for re-reading the data that it already contains: It leaves the limit unchanged and sets the position to zero. |
void |
setLittleEndian(boolean aBool)
Changes the little-endianness of this ByteBuffer to specified boolean value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteBuffer()
| Method Detail |
|---|
public void flip()
public void putInt(int val)
val - int int value.
public void putShort(int val,
int pos)
val - int short valuepos - int offset from position.public int length()
public void limit(int lim)
lim - int limit of data in this ByteBuffer.public in position()
public void init()
public void putInt(int val,
int pos)
val - int int value.pos - int offset from current position.public void setLittleEndian(boolean aBool)
aBool - boolean new value of the little-endianness property.public boolean hasRemaining()
public int remaining()
public boolean isLittleEndian()
public int at(int pos)
pos - int offset from position to get value from.
public void clear()
public int get()
public void putShort(int val)
val - int short valuepublic int getShort()
public void rewind()
public int getInt()
public limit limit()
public int getShortAt(int pos)
pos - int offset from current position.
public void put(int value)
value - int byte value to store.public void position(int pos)
pos - int new position of the read/write marker.public int getIntAt(int pos)
pos - int offset from current position.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||