Class StreamOutput
java.lang.Object
org.apache.commons.crypto.stream.output.StreamOutput
- All Implemented Interfaces:
Closeable, AutoCloseable, Output
The StreamOutput class takes a
OutputStream object and wraps it
as Output object acceptable by CryptoOutputStream
as the output target.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]private final intprivate final OutputStream -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Overrides theOutput.close().voidflush()Overrides theOutput.flush().protected OutputStreamgetOut()Gets the output stream.intwrite(ByteBuffer src) Overrides theOutput.write(ByteBuffer).
-
Field Details
-
buf
private final byte[] buf -
bufferSize
private final int bufferSize -
out
-
-
Constructor Details
-
StreamOutput
Constructs a new instance.- Parameters:
out- the OutputStream object.bufferSize- the buffer size.
-
-
Method Details
-
close
Overrides theOutput.close(). Closes this output and releases any system resources associated with the under layer output.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceOutput- Throws:
IOException- if an I/O error occurs.
-
flush
Overrides theOutput.flush(). Flushes this output and forces any buffered output bytes to be written out if the under layer output method support.- Specified by:
flushin interfaceOutput- Throws:
IOException- if an I/O error occurs.
-
getOut
-
write
Overrides theOutput.write(ByteBuffer). Writes a sequence of bytes to this output from the given buffer.- Specified by:
writein interfaceOutput- Parameters:
src- The buffer from which bytes are to be retrieved.- Returns:
- The number of bytes written, possibly zero.
- Throws:
IOException- if an I/O error occurs.
-