public class CircularByteBuffer
extends java.lang.Object
Constructor and Description |
---|
CircularByteBuffer(int size)
Constructs a buffer capable of holding the given number of bytes.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Signals that the buffer is closed and no further writes will occur.
|
int |
getBytesAvailableToRead()
Returns the number of bytes that are in the buffer at the time of the method invocation.
|
int |
getCapacity()
Returns the total capacity of the buffer (empty+filled).
|
boolean |
isClosed()
Returns true if the buffer is closed, false otherwise.
|
int |
read(byte[] bytes,
int start,
int size)
Read bytes from the buffer into the supplied array.
|
int |
write(byte[] bytes,
int start,
int size)
Write bytes into the buffer from the supplied array.
|
public CircularByteBuffer(int size)
public int write(byte[] bytes, int start, int size)
public int read(byte[] bytes, int start, int size)
public void close()
public boolean isClosed()
public int getCapacity()
public int getBytesAvailableToRead()