- java.lang.Object
-
- java.io.InputStream
-
- io.github.mmm.crypto.io.InputStreamWrapper
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
CryptorInputStream
public class InputStreamWrapper extends InputStream
AnInputStreamthat wraps anotherInputStreamto delegate from.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
-
Constructor Summary
Constructors Constructor Description InputStreamWrapper(InputStream delegate)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected InputStreamgetDelegate()intread()intread(byte[] b)intread(byte[] b, int off, int len)protected voidrequireNotClosed()-
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
InputStreamWrapper
public InputStreamWrapper(InputStream delegate)
The constructor.- Parameters:
delegate- thedelegate. May not benull.
-
-
Method Detail
-
getDelegate
protected InputStream getDelegate()
- Returns:
- the wrapped
InputStreamto delegate from. May not benull.
-
requireNotClosed
protected void requireNotClosed() throws IOException- Throws:
IOException- if the stream has already been closed.
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public final int read(byte[] b) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
-