public class ChannelOutput extends Object implements Output
WritableByteChannel
object and
wraps it as Output
object acceptable by
CryptoOutputStream
as the output target.Constructor and Description |
---|
ChannelOutput(WritableByteChannel channel)
Constructs a
ChannelOutput . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Overrides the
Output.close() . |
void |
flush()
Overrides the
Output.flush() . |
int |
write(ByteBuffer src)
Overrides the
Output.write(ByteBuffer) . |
public ChannelOutput(WritableByteChannel channel)
ChannelOutput
.channel
- the WritableByteChannel object.public void close() throws IOException
Output.close()
. Closes this output and releases any
system resources associated with the under layer output.close
in interface Closeable
close
in interface AutoCloseable
close
in interface Output
IOException
- if an I/O error occurs.public void flush() throws IOException
Output.flush()
. Flushes this output and forces any
buffered output bytes to be written out if the under layer output method
support.flush
in interface Output
IOException
- if an I/O error occurs.public int write(ByteBuffer src) throws IOException
Output.write(ByteBuffer)
.
Writes a sequence of bytes to this output from the given buffer.write
in interface Output
src
- The buffer from which bytes are to be retrieved.IOException
- if an I/O error occurs.Copyright © 2016–2022 The Apache Software Foundation. All rights reserved.