public class RingBuffer
extends java.lang.Object
Constructor and Description |
---|
RingBuffer(int bufferSize)
Ring buffer
|
Modifier and Type | Method and Description |
---|---|
int |
add(byte[] buf,
int length)
Adds byte array to ring buffer
|
void |
clear()
Clear ring buffer
|
int |
get(byte[] buf,
int length)
Gets ring buffer to byte array
|
int |
getBufferdLength()
Gets buffered length
|
int |
getRingBufferSize()
Gets ring buffer size
|
public RingBuffer(int bufferSize)
bufferSize
- buffer size. It needs enough size e.g.1024public int getRingBufferSize()
public int getBufferdLength()
public int add(byte[] buf, int length)
buf
- byte arraylength
- added lengthpublic int get(byte[] buf, int length)
buf
- byte arraylength
- gotten lengthpublic void clear()