public class ByteBufferQueue extends AbstractQueue<Byte>
Modifier and Type | Class and Description |
---|---|
class |
ByteBufferQueue.ByteQueueIterator |
Modifier and Type | Field and Description |
---|---|
protected static int |
CLOSED_OFFSET |
protected static byte |
FALSE |
protected static int |
HEAD_OFFSET |
protected static int |
INIT_OFFSET |
protected static int |
POINTER_SIZE |
protected static int |
QUEUE_OFFSET |
protected static int |
TAIL_OFFSET |
protected static byte |
TRUE |
Constructor and Description |
---|
ByteBufferQueue(ByteBuffer buffer,
int startIndex,
int length) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected ByteBuffer |
getBuffer() |
int |
getCapacity() |
int |
getEndIndex() |
protected int |
getHead() |
protected int |
getQueueStartIndex() |
int |
getStartIndex() |
protected int |
getTail() |
protected int |
increment(int index) |
void |
init() |
boolean |
isClosed() |
boolean |
isEmpty() |
boolean |
isFull() |
boolean |
isInitialized() |
Iterator<Byte> |
iterator() |
boolean |
offer(Byte e) |
Byte |
peek() |
Byte |
poll() |
protected byte |
read() |
protected void |
setHead(int newHead) |
protected void |
setTail(int newTail) |
int |
size() |
protected void |
write(byte date) |
contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
contains, containsAll, equals, hashCode, remove, removeAll, retainAll, toArray, toArray
protected static final byte TRUE
protected static final byte FALSE
protected static final int POINTER_SIZE
protected static final int HEAD_OFFSET
protected static final int TAIL_OFFSET
protected static final int INIT_OFFSET
protected static final int CLOSED_OFFSET
protected static final int QUEUE_OFFSET
public ByteBufferQueue(ByteBuffer buffer, int startIndex, int length)
public void init()
public boolean isInitialized()
public int size()
size
in interface Collection<Byte>
size
in class AbstractCollection<Byte>
public Byte peek()
protected ByteBuffer getBuffer()
protected byte read()
protected void write(byte date)
protected int increment(int index)
public boolean isEmpty()
isEmpty
in interface Collection<Byte>
isEmpty
in class AbstractCollection<Byte>
public boolean isFull()
public int getCapacity()
public int getStartIndex()
public int getEndIndex()
protected int getQueueStartIndex()
protected int getHead()
protected void setHead(int newHead)
protected int getTail()
protected void setTail(int newTail)
public void close() throws IOException
IOException
public boolean isClosed()
public boolean offer(Byte e)
public Byte poll()
Copyright © 2014. All Rights Reserved.