Package org.bouncycastle.util.io
Class TeeOutputStream
java.lang.Object
java.io.OutputStream
org.bouncycastle.util.io.TeeOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class TeeOutputStream extends OutputStream
-
Constructor Summary
Constructors Constructor Description TeeOutputStream(OutputStream output1, OutputStream output2) -
Method Summary
Modifier and Type Method Description voidclose()Closes this stream.voidflush()Flushes this stream.voidwrite(byte[] buf)Equivalent towrite(buffer, 0, buffer.length).voidwrite(byte[] buf, int off, int len)Writescountbytes from the byte arraybufferstarting at positionoffsetto this stream.voidwrite(int b)Writes a single byte to this stream.
-
Constructor Details
-
TeeOutputStream
-
-
Method Details
-
write
Description copied from class:OutputStreamEquivalent towrite(buffer, 0, buffer.length).- Overrides:
writein classOutputStream- Throws:
IOException
-
write
Description copied from class:OutputStreamWritescountbytes from the byte arraybufferstarting at positionoffsetto this stream.- Overrides:
writein classOutputStream- Parameters:
buf- the buffer to be written.off- the start position inbufferfrom where to get bytes.len- the number of bytes frombufferto write to this stream.- Throws:
IOException- if an error occurs while writing to this stream.
-
write
Description copied from class:OutputStreamWrites a single byte to this stream. Only the least significant byte of the integeroneByteis written to the stream.- Specified by:
writein classOutputStream- Parameters:
b- the byte to be written.- Throws:
IOException- if an error occurs while writing to this stream.
-
flush
Description copied from class:OutputStreamFlushes this stream. Implementations of this method should ensure that any buffered data is written out. This implementation does nothing.- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException- if an error occurs while flushing this stream.
-
close
Description copied from class:OutputStreamCloses this stream. Implementations of this method should free any resources used by the stream. This implementation does nothing.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException- if an error occurs while closing this stream.
-