|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasn.util.DynamicBuffer
This class implements a buffer of bytes that grows as needed.
| Constructor Summary | |
DynamicBuffer(int capacity)
Creates a byte buffer with the specified initial capacity. |
|
| Method Summary | |
int |
getPosition()
Returns this buffer's position. |
void |
put(byte b)
Writes the given byte into this buffer at the current position, and then increments the position. |
void |
put(byte[] b,
int off,
int len)
|
void |
rewind()
|
void |
setPosition(int position)
Sets this buffer's position. |
void |
writeTo(OutputStream out)
Writes the bytes contained in this buffer into the specified output stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DynamicBuffer(int capacity)
capacity - the initial capacity of the buffer.
throws IllegalArgumentException if the specified initial capacity is
negative.| Method Detail |
public void put(byte b)
b - the byte to be written.
public void put(byte[] b,
int off,
int len)
public int getPosition()
public void setPosition(int position)
position - the new position value; must be non-negative and no
larger than the current limit
public void writeTo(OutputStream out)
throws IOException
IOException - if an I/O error occured.public void rewind()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||