public class MarkShieldInputStream extends ProxyInputStream
ByteArrayInputStream
which removes the synchronization overhead for non-concurrent
access; as such this class is not thread-safe.
Proxy stream that prevents the underlying input stream from being marked/reset.
This class is typically used in cases where an input stream that supports marking needs to be passed to a component that wants to explicitly mark the stream, but it is not desirable to allow marking of the stream.
ProxyInputStream.AbstractBuilder<T,B extends AbstractStreamBuilder<T,B>>in| Constructor and Description |
|---|
MarkShieldInputStream(InputStream in)
Constructs a proxy that shields the given input stream from being
marked or rest.
|
| Modifier and Type | Method and Description |
|---|---|
void |
mark(int readLimit)
Invokes the delegate's
InputStream.mark(int) method. |
boolean |
markSupported()
Invokes the delegate's
InputStream.markSupported() method. |
void |
reset()
Invokes the delegate's
InputStream.reset() method. |
afterRead, available, beforeRead, checkOpen, close, handleIOException, isClosed, read, read, read, setReference, skip, unwrappublic MarkShieldInputStream(InputStream in)
in - underlying input streampublic void mark(int readLimit)
ProxyInputStreamInputStream.mark(int) method.mark in class ProxyInputStreamreadLimit - read ahead limit.public boolean markSupported()
ProxyInputStreamInputStream.markSupported() method.markSupported in class ProxyInputStreamtrue if this stream instance supports the mark and reset methods; false otherwise.ProxyInputStream.mark(int),
ProxyInputStream.reset()public void reset()
throws IOException
ProxyInputStreamInputStream.reset() method.reset in class ProxyInputStreamIOException - if this stream has not been marked or if the mark has been invalidated.