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 TypeMethodDescriptionvoid
close()
Overrides theOutput.close()
.void
flush()
Overrides theOutput.flush()
.int
write
(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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in 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:
flush
in 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:
write
in 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.
-