|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.activity.transform.ByteQueue
A ByteQueue
enqueues and dequeues bytes.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE Copyright statement |
private static int |
DEFAULT_QUEUE_CAPACITY Default start size for the queue |
private int |
mAvailable Keeps track of the number of queued bytes available for dequeueing |
private int |
mEnd Index to the end of the queue |
private int |
mHead Index to the head of the queue |
private byte[] |
mQueue Byte array for the atual queue |
Constructor Summary | |
ByteQueue() Constructs a byte queue with the default initial queue capacity |
|
ByteQueue(int queueCapacity) Constructs a byte queue with the specified initial queue capacity. |
Method Summary | |
int |
available() Returns the number of bytes avaialable for reading from the queue. |
int |
dequeue(byte[] bytes, int start, int length) Dequeues an array of bytes. |
void |
empty() Empties the queue, freeing up resources. |
void |
enqueue(byte[] bytes, int index, int length) Enqueues an array of bytes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private static final int DEFAULT_QUEUE_CAPACITY
private byte[] mQueue
private int mHead
private int mEnd
private int mAvailable
Constructor Detail |
public ByteQueue()
public ByteQueue(int queueCapacity)
queueCapacity
- The initial queue capacity.Method Detail |
public void empty()
public void enqueue(byte[] bytes, int index, int length)
bytes
- The array of bytes.index
- The index within the array to start enqueing bytes from.length
- The length of bytes to enqueu, from the start index.public int dequeue(byte[] bytes, int start, int length)
bytes
- The byte[]
to dequeue into.start
- The start index within bytes
to dequeue into.length
- The maximum number of bytes to dequeue.public int available()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |