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
-
Constructor Summary
Constructors Constructor Description TeeInputStream(InputStream input, OutputStream output) -
Method Summary
Modifier and Type Method Description voidclose()Closes this stream.OutputStreamgetOutputStream()intread()Reads a single byte from this stream and returns it as an integer in the range from 0 to 255.intread(byte[] buf)Equivalent toread(buffer, 0, buffer.length).intread(byte[] buf, int off, int len)Reads up tobyteCountbytes from this stream and stores them in the byte arraybufferstarting atbyteOffset.Methods inherited from class java.io.InputStream
available, mark, markSupported, reset, skip
-
Constructor Details
-
TeeInputStream
-
-
Method Details
-
read
Description copied from class:InputStreamEquivalent toread(buffer, 0, buffer.length).- Overrides:
readin classInputStream- Throws:
IOException
-
read
Description copied from class:InputStreamReads up tobyteCountbytes from this stream and stores them in the byte arraybufferstarting atbyteOffset. Returns the number of bytes actually read or -1 if the end of the stream has been reached.- Overrides:
readin classInputStream- Throws:
IOException- if the stream is closed or another IOException occurs.
-
read
Description copied from class:InputStreamReads a single byte from this stream and returns it as an integer in the range from 0 to 255. Returns -1 if the end of the stream has been reached. Blocks until one byte has been read, the end of the source stream is detected or an exception is thrown.- Specified by:
readin classInputStream- Throws:
IOException- if the stream is closed or another IOException occurs.
-
close
Description copied from class:InputStreamCloses this stream. Concrete implementations of this class should free any resources during close. This implementation does nothing.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException- if an error occurs while closing this stream.
-
getOutputStream
-