|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
ccs.audio.NonBlockingFIFO
public class NonBlockingFIFO
A FIFO which does not allow its methods to block. Bytes may be bulk read out of the stream as for a normal input stream, and methods are provided to allow the FIFO to be written to. MT-Safe.
Constructor Summary | |
---|---|
NonBlockingFIFO()
A 16K FIFO. |
|
NonBlockingFIFO(int capacity)
A FIFO of defined capacity. |
Method Summary | |
---|---|
int |
available()
The number of bytes available to read. |
void |
close()
Close returns the FIFO to a pristine condition. |
int |
free()
The number of bytes which could be written. |
boolean |
markSupported()
This stream does not support marks. |
int |
read()
Read a single byte, unless this would block. |
int |
read(byte[] b)
Identical to read(b, 0, b.length) . |
int |
read(byte[] b,
int off,
int len)
Read zero or more bytes from the FIFO - this will read zero bytes rather than blocking. |
long |
skip(long n)
Skip bytes without blocking. |
void |
write(byte[] b)
Identical to write(b, 0, b.length . |
void |
write(byte[] b,
int off,
int len)
Write bytes into the FIFO. |
Methods inherited from class java.io.InputStream |
---|
mark, reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NonBlockingFIFO()
public NonBlockingFIFO(int capacity)
Method Detail |
---|
public int read() throws java.io.IOException
read
in class java.io.InputStream
WouldBlockException
- if it would.
java.io.IOException
public int read(byte[] b) throws java.io.IOException
read(b, 0, b.length)
.
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
available
.
read
in class java.io.InputStream
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
public int available()
available
in class java.io.InputStream
public boolean markSupported()
markSupported
in class java.io.InputStream
public void close()
close
in interface java.io.Closeable
close
in class java.io.InputStream
public int free()
public void write(byte[] b) throws java.io.IOException
write(b, 0, b.length
.
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
len
> free
- will throw.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |