Package org.bouncycastle.util.io
Class TeeInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.bouncycastle.util.io.TeeInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class TeeInputStream extends InputStream
An input stream which copies anything read through it to another stream.
-
-
Constructor Summary
Constructors Constructor Description TeeInputStream(InputStream input, OutputStream output)
Base constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
OutputStream
getOutputStream()
int
read()
int
read(byte[] buf)
int
read(byte[] buf, int off, int len)
-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
TeeInputStream
public TeeInputStream(InputStream input, OutputStream output)
Base constructor.- Parameters:
input
- input stream to be wrapped.output
- output stream to copy any input read to.
-
-
Method Detail
-
available
public int available() throws IOException
- Overrides:
available
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] buf) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] buf, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
getOutputStream
public OutputStream getOutputStream()
-
-