Class ChannelOutput
- java.lang.Object
-
- org.apache.commons.crypto.stream.output.ChannelOutput
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,Output
public class ChannelOutput extends java.lang.Object implements Output
The ChannelOutput class takes aWritableByteChannel
object and wraps it asOutput
object acceptable byCryptoOutputStream
as the output target.
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.channels.WritableByteChannel
channel
-
Constructor Summary
Constructors Constructor Description ChannelOutput(java.nio.channels.WritableByteChannel channel)
Constructs aChannelOutput
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Overrides theOutput.close()
.void
flush()
Overrides theOutput.flush()
.int
write(java.nio.ByteBuffer src)
Overrides theOutput.write(ByteBuffer)
.
-
-
-
Constructor Detail
-
ChannelOutput
public ChannelOutput(java.nio.channels.WritableByteChannel channel)
Constructs aChannelOutput
.- Parameters:
channel
- the WritableByteChannel object.
-
-
Method Detail
-
close
public void close() throws java.io.IOException
Overrides theOutput.close()
. Closes this output and releases any system resources associated with the under layer output.
-
flush
public void flush() throws java.io.IOException
Overrides theOutput.flush()
. Flushes this output and forces any buffered output bytes to be written out if the under layer output method support.
-
write
public int write(java.nio.ByteBuffer src) throws java.io.IOException
Overrides theOutput.write(ByteBuffer)
. Writes a sequence of bytes to this output from the given buffer.
-
-