protected class CircularByteBuffer.CircularByteBufferInputStream
extends java.io.InputStream
Modifier | Constructor and Description |
---|---|
protected |
CircularByteBufferInputStream() |
Modifier and Type | Method and Description |
---|---|
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.
|
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 interface java.lang.AutoCloseable
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 skipjava.lang.IllegalArgumentException
- if n is negative.java.io.IOException
- if the stream is closed.Copyright (c) 2001-2020 by Stephen Ostermiller