|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
com.Ostermiller.util.CircularByteBuffer.CircularByteBufferInputStream
protected class CircularByteBuffer.CircularByteBufferInputStream
Class for reading from a circular byte buffer.
Constructor Summary | |
---|---|
protected |
CircularByteBuffer.CircularByteBufferInputStream()
|
Method Summary | |
---|---|
int |
available()
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. |
void |
close()
Close the stream. |
void |
mark(int readAheadLimit)
Mark the present position in the stream. |
boolean |
markSupported()
Tell whether this stream supports the mark() operation. |
int |
read()
Read a single byte. |
int |
read(byte[] cbuf)
Read bytes into an array. |
int |
read(byte[] cbuf,
int off,
int len)
Read bytes into a portion of an array. |
void |
reset()
Reset the stream. |
long |
skip(long n)
Skip bytes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected CircularByteBuffer.CircularByteBufferInputStream()
Method Detail |
---|
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
- if the stream is closed.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.InputStream
java.io.IOException
- never.public void mark(int readAheadLimit)
The readAheadLimit must be less than the size of circular buffer, otherwise this method has no effect.
mark
in class java.io.InputStream
readAheadLimit
- Limit on the number of bytes that may be read while
still preserving the mark. After reading this many bytes, attempting to
reset the stream will fail.public boolean markSupported()
markSupported
in class java.io.InputStream
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
- if the stream is closed.public int read(byte[] cbuf) throws java.io.IOException
read
in class java.io.InputStream
cbuf
- Destination buffer.
java.io.IOException
- if the stream is closed.public int read(byte[] cbuf, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
cbuf
- Destination buffer.off
- Offset at which to start storing bytes.len
- Maximum number of bytes to read.
java.io.IOException
- if the stream is closed.public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
- if the stream is closed.public long skip(long n) throws java.io.IOException, java.lang.IllegalArgumentException
skip
in class java.io.InputStream
n
- The number of bytes to skip
java.lang.IllegalArgumentException
- if n is negative.
java.io.IOException
- if the stream is closed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |