public class MarkableStream extends FilterInputStream
in
Constructor and Description |
---|
MarkableStream(InputStream input) |
Modifier and Type | Method and Description |
---|---|
void |
mark(int readLimit)
Calls the
in.mark(int) method. |
boolean |
markSupported()
Calls the
in.markSupported() method. |
int |
read()
Calls the
in.read() method |
int |
read(byte[] dest,
int offset,
int count)
Calls the
in.read(byte[], int, int) method. |
void |
reset()
Calls the
in.reset() method. |
long |
skip(long num)
Rewind a Stream created by toRewindableStream().
|
static InputStream |
toMarkableStream(InputStream input) |
available, close, read
finalize, hashCode
public MarkableStream(InputStream input)
public int read() throws IOException
FilterInputStream
in.read()
methodread
in class FilterInputStream
in.read()
IOException
- If an error occurspublic int read(byte[] dest, int offset, int count) throws IOException
FilterInputStream
in.read(byte[], int, int)
method.read
in class FilterInputStream
dest
- The buffer to read bytes intooffset
- The index into the buffer to start storing bytescount
- The maximum number of bytes to read.in.read(byte[], int, int)
IOException
- If an error occurspublic boolean markSupported()
FilterInputStream
in.markSupported()
method.markSupported
in class FilterInputStream
true
if mark/reset is supported, false
otherwisepublic void mark(int readLimit)
FilterInputStream
in.mark(int)
method.mark
in class FilterInputStream
readLimit
- The parameter passed to in.mark(int)
public void reset() throws IOException
FilterInputStream
in.reset()
method.reset
in class FilterInputStream
IOException
- If an error occurspublic static InputStream toMarkableStream(InputStream input)
public long skip(long num) throws IOException
skip
in class FilterInputStream
stream
- the RandomStream returned by toRewindableStream().in.skip(long)
IOException
- if an IO error occurs.