|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjodd.util.buffer.FastByteBuffer
public class FastByteBuffer
Fast, fast byte buffer.
| Constructor Summary | |
|---|---|
FastByteBuffer()
Creates a new byte buffer. |
|
FastByteBuffer(int size)
Creates a new byte buffer, with a buffer capacity of
the specified size, in bytes. |
|
| Method Summary | |
|---|---|
FastByteBuffer |
append(byte element)
Appends single byte to buffer. |
FastByteBuffer |
append(byte[] array)
Appends byte array to buffer. |
FastByteBuffer |
append(byte[] array,
int off,
int len)
Appends byte array to buffer. |
FastByteBuffer |
append(FastByteBuffer buff)
Appends another fast buffer to this one. |
byte[] |
array(int index)
Returns byte inner array chunk at given index. |
void |
clear()
Resets the buffer content. |
byte |
get(int index)
Returns byte element at given index. |
int |
index()
Returns current index of inner byte array chunk. |
boolean |
isEmpty()
Tests if this buffer has no elements. |
int |
offset()
Returns the offset of last used element in current inner array chunk. |
int |
size()
Returns buffer size. |
byte[] |
toArray()
Creates byte array from buffered content. |
byte[] |
toArray(int start,
int len)
Creates byte subarray from buffered content. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FastByteBuffer()
byte buffer. The buffer capacity is
initially 1024 bytes, though its size increases if necessary.
public FastByteBuffer(int size)
byte buffer, with a buffer capacity of
the specified size, in bytes.
size - the initial size.
java.lang.IllegalArgumentException - if size is negative.| Method Detail |
|---|
public FastByteBuffer append(byte[] array,
int off,
int len)
byte array to buffer.
public FastByteBuffer append(byte[] array)
byte array to buffer.
public FastByteBuffer append(byte element)
byte to buffer.
public FastByteBuffer append(FastByteBuffer buff)
public int size()
public boolean isEmpty()
public int index()
byte array chunk.
Represents the index of last used inner array chunk.
public int offset()
public byte[] array(int index)
byte inner array chunk at given index.
May be used for iterating inner chunks in fast manner.
public void clear()
public byte[] toArray()
byte array from buffered content.
public byte[] toArray(int start,
int len)
byte subarray from buffered content.
public byte get(int index)
byte element at given index.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||