Class ChannelOutput
java.lang.Object
org.apache.commons.crypto.stream.output.ChannelOutput
- All Implemented Interfaces:
Closeable,AutoCloseable,Output
The ChannelOutput class takes a
WritableByteChannel object and
wraps it as Output object acceptable by
CryptoOutputStream as the output target.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Overrides theOutput.close().voidflush()Overrides theOutput.flush().intwrite(ByteBuffer src) Overrides theOutput.write(ByteBuffer).
-
Field Details
-
channel
-
-
Constructor Details
-
ChannelOutput
Constructs aChannelOutput.- Parameters:
channel- the WritableByteChannel object.
-
-
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.
-
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.
-