public class StreamOutput extends Object implements Output
OutputStream object and wraps it
as Output object acceptable by CryptoOutputStream
as the output target.| Constructor and Description |
|---|
StreamOutput(OutputStream out,
int bufferSize)
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Overrides the
Output.close(). |
void |
flush()
Overrides the
Output.flush(). |
protected OutputStream |
getOut()
Gets the output stream.
|
int |
write(ByteBuffer src)
Overrides the
Output.write(ByteBuffer). |
public StreamOutput(OutputStream out, int bufferSize)
out - the OutputStream object.bufferSize - the buffer size.public void close() throws IOException
Output.close(). Closes this output and releases any
system resources associated with the under layer output.close in interface Closeableclose in interface AutoCloseableclose in interface OutputIOException - 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 OutputIOException - if an I/O error occurs.protected OutputStream getOut()
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 Outputsrc - 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.