|
com.Ostermiller.util Java Utilities |
|||||||
| 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 IOException
available in class InputStreamIOException - if the stream is closed.
public void close()
throws IOException
close in interface Closeableclose in class InputStreamIOException - 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 InputStreamreadAheadLimit - 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 InputStream
public int read()
throws IOException
read in class InputStreamIOException - if the stream is closed.
public int read(byte[] cbuf)
throws IOException
read in class InputStreamcbuf - Destination buffer.
IOException - if the stream is closed.
public int read(byte[] cbuf,
int off,
int len)
throws IOException
read in class InputStreamcbuf - Destination buffer.off - Offset at which to start storing bytes.len - Maximum number of bytes to read.
IOException - if the stream is closed.
public void reset()
throws IOException
reset in class InputStreamIOException - if the stream is closed.
public long skip(long n)
throws IOException,
IllegalArgumentException
skip in class InputStreamn - The number of bytes to skip
IllegalArgumentException - if n is negative.
IOException - if the stream is closed.
|
com.Ostermiller.util Java Utilities |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Copyright (c) 2001-2007 by Stephen Ostermiller