Package org.apache.commons.io.input
Class MarkShieldInputStream
- java.lang.Object
 - 
- java.io.InputStream
 - 
- java.io.FilterInputStream
 - 
- org.apache.commons.io.input.ProxyInputStream
 - 
- org.apache.commons.io.input.MarkShieldInputStream
 
 
 
 
 
- 
- All Implemented Interfaces:
 java.io.Closeable,java.lang.AutoCloseable
public class MarkShieldInputStream extends ProxyInputStream
This is an alternative toByteArrayInputStreamwhich 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.
- Since:
 - 2.8.0
 
 
- 
- 
Constructor Summary
Constructors Constructor Description MarkShieldInputStream(java.io.InputStream in)Constructs a proxy that shields the given input stream from being marked or rest. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmark(int readLimit)Invokes the delegate'smark(int)method.booleanmarkSupported()Invokes the delegate'smarkSupported()method.voidreset()Invokes the delegate'sreset()method.- 
Methods inherited from class org.apache.commons.io.input.ProxyInputStream
available, close, read, read, read, skip, unwrap 
 - 
 
 - 
 
- 
- 
Method Detail
- 
mark
public void mark(int readLimit)
Description copied from class:ProxyInputStreamInvokes the delegate'smark(int)method.- Overrides:
 markin classProxyInputStream- Parameters:
 readLimit- read ahead limit
 
- 
markSupported
public boolean markSupported()
Description copied from class:ProxyInputStreamInvokes the delegate'smarkSupported()method.- Overrides:
 markSupportedin classProxyInputStream- Returns:
 - true if mark is supported, otherwise false
 
 
- 
reset
public void reset() throws java.io.IOExceptionDescription copied from class:ProxyInputStreamInvokes the delegate'sreset()method.- Overrides:
 resetin classProxyInputStream- Throws:
 java.io.IOException- if an I/O error occurs.
 
 - 
 
 -