
public final class MarkSupportedInputStream extends InputStream
Wraps an InputStream to ensure InputStream.markSupported() returns true.
Note: if calls to read() exceed the readLimit parameter of mark(int)
then the mark is removed and a call to reset() will throw an IOException.
| Constructor and Description |
|---|
MarkSupportedInputStream(InputStream delegate)
Create an InputStream with mark supported
|
| Modifier and Type | Method and Description |
|---|---|
static InputStream |
ensureMarkSupported(InputStream input)
For efficient use of memory, this convenience static method
returns the
input argument IFF it claims to to support marking,
otherwise the stream is wrapped |
void |
mark(int readLimit) |
boolean |
markSupported() |
int |
read() |
void |
reset() |
public MarkSupportedInputStream(InputStream delegate)
delegate - the InputStream to wrappublic static InputStream ensureMarkSupported(InputStream input)
input argument IFF it claims to to support marking,
otherwise the stream is wrappedinput - the InputStream to checkInputStream that supports markingpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic final boolean markSupported()
markSupported in class InputStreampublic void mark(int readLimit)
mark in class InputStreampublic void reset()
throws IOException
reset in class InputStreamIOExceptionCopyright © 2017 earcam. All rights reserved.