public interface BytesRingBuffer extends BytesRingBufferStats, BytesConsumer
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
static Class<BytesRingBuffer> |
clazz() |
void |
clear()
clears the ring buffer but moving the read position to the write position
|
boolean |
isEmpty() |
static BytesRingBuffer |
newInstance(NativeBytesStore<Void> bytesStore) |
boolean |
offer(BytesStore bytes0)
Inserts the specified element at the tail of this queue if it is possible to do so
immediately without exceeding the queue's capacity,
|
boolean |
read(BytesOut using)
Retrieves and removes the head of this queue, or returns
null if this queue is
empty. |
long |
readRemaining() |
static long |
sizeFor(long capacity) |
capacity, getAndClearReadCount, getAndClearWriteCount, maxCopyTimeNs, minNumberOfWriteBytesRemaining
@NotNull static BytesRingBuffer newInstance(@NotNull NativeBytesStore<Void> bytesStore)
@NotNull static Class<BytesRingBuffer> clazz() throws ClassNotFoundException
ClassNotFoundException
static long sizeFor(long capacity)
void clear()
boolean offer(@NotNull BytesStore bytes0)
bytes0
- the bytes0
that you wish to add to the ring buffertrue
upon success and false
if this queue is full.boolean read(@NotNull BytesOut using) throws IllegalStateException
null
if this queue is
empty.read
in interface BytesConsumer
using
- Bytes to read into.IllegalStateException
- is the using
buffer is not large enoughlong readRemaining()
boolean isEmpty()
Copyright © 2016. All rights reserved.