Method Summary |
|
byte[] | array() Get the underlying array, if one exists. |
byte[] | asArray() |
Buffer | asImmutableBuffer() |
Buffer | asMutableBuffer() |
Buffer | asNonVolatileBuffer() |
Buffer | asReadOnlyBuffer() |
Buffer | buffer() Get the unerlying buffer. |
int | capacity() The capacity of the buffer. |
void | clear() Clear the buffer. |
void | compact() Compact the buffer by discarding bytes before the postion (or mark if set). |
boolean | equalsIgnoreCase(Buffer buffer) |
byte | get() Get the byte at the current getIndex and increment it. |
int | get(byte[] b, int offset, int length) Get bytes from the current postion and put them into the passed byte array.
The getIndex is incremented by the number of bytes copied into the array.
Parameters: b - The byte array to fill. Parameters: offset - Offset in the array. Parameters: length - The max number of bytes to read. |
Buffer | get(int length) |
int | getIndex() The index within the buffer that will next be read or written. |
boolean | hasContent() |
boolean | isImmutable() |
boolean | isReadOnly() a boolean value true if the buffer is readonly. |
boolean | isVolatile() a boolean value true if the buffer contents may change via alternate paths than this buffer. |
int | length() |
void | mark() Set the mark to the current getIndex. |
void | mark(int offset) |
int | markIndex() The current index of the mark. |
byte | peek() Get the byte at the current getIndex without incrementing the getIndex. |
byte | peek(int index) Get the byte at a specific index in the buffer. |
Buffer | peek(int index, int length) |
int | peek(int index, byte[] b, int offset, int length) |
int | poke(int index, Buffer src) Put the contents of the buffer at the specific index.
Parameters: index - an int value Parameters: src - a Buffer . |
void | poke(int index, byte b) Put a specific byte to a specific getIndex. |
int | poke(int index, byte b, int offset, int length) Put a specific byte to a specific getIndex. |
int | put(Buffer src) Write the bytes from the source buffer to the current getIndex.
Parameters: src - The source Buffer it is not modified. |
void | put(byte b) Put a byte to the current getIndex and increment the getIndex. |
int | put(byte[] b, int offset, int length) Put a byte to the current getIndex and increment the getIndex. |
int | put(byte[] b) Put a byte to the current getIndex and increment the getIndex. |
int | putIndex() The index of the first element that should not be read. |
int | readFrom(InputStream in, int max) |
void | reset() |
void | setGetIndex(int newStart) Set the buffers start getIndex. |
void | setMarkIndex(int newMark) Set a specific value for the mark. |
void | setPutIndex(int newLimit) |
int | skip(int n) Skip _content. |
Buffer | slice() |
Buffer | sliceFromMark() |
Buffer | sliceFromMark(int length) |
int | space() the space remaining in the buffer. |
String | toDetailString() |
void | writeTo(OutputStream out) |