|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kc7bfi.jflac.util.RingBuffer
public class RingBuffer
RingBuffer class.
Field Summary | |
---|---|
protected byte[] |
buffer
|
protected int |
bufferSize
|
protected static int |
DEFAULT_BUFFER_SIZE
|
protected boolean |
eof
|
protected int |
getHere
|
protected int |
putHere
|
protected Object |
signal
|
Constructor Summary | |
---|---|
RingBuffer()
Constructor. |
|
RingBuffer(int size)
Constructor. |
Method Summary | |
---|---|
void |
empty()
Empty the ring buffer. |
int |
get(byte[] data,
int offset,
int len)
Read data from the ring buffer. |
int |
getAvailable()
Return the bytes available for reading. |
boolean |
isEOF()
Return EOF status. |
static void |
main(String[] args)
Test main routine. |
void |
put(byte[] data,
int offset,
int len)
Put data into the ring buffer. |
int |
putAvailable()
return the space avaiable for writing. |
void |
resize(int newSize)
Resize the ring buffer. |
void |
setEOF(boolean eof)
Set the EOF status. |
int |
size()
Return the size of the ring buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int DEFAULT_BUFFER_SIZE
protected volatile int bufferSize
protected byte[] buffer
protected volatile int putHere
protected volatile int getHere
protected volatile boolean eof
protected Object signal
Constructor Detail |
---|
public RingBuffer(int size)
size
- The size of the ring bufferpublic RingBuffer()
Method Detail |
---|
public int size()
public void resize(int newSize)
newSize
- The new size of the ring bufferpublic int putAvailable()
public void empty()
public void put(byte[] data, int offset, int len)
data
- The data to writeoffset
- The start position in the data arraylen
- The bytes from the data array to writepublic int getAvailable()
public int get(byte[] data, int offset, int len)
data
- Where to put the dataoffset
- The offset into the data array to start putting datalen
- The maximum data to read
public boolean isEOF()
public void setEOF(boolean eof)
eof
- The eof to set.public static void main(String[] args)
args
- Not used
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |