Class StreamOutput
- java.lang.Object
-
- org.apache.commons.crypto.stream.output.StreamOutput
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,Output
public class StreamOutput extends java.lang.Object implements Output
The StreamOutput class takes aOutputStream
object and wraps it asOutput
object acceptable byCryptoOutputStream
as the output target.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
buf
private int
bufferSize
private java.io.OutputStream
out
-
Constructor Summary
Constructors Constructor Description StreamOutput(java.io.OutputStream out, int bufferSize)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Overrides theOutput.close()
.void
flush()
Overrides theOutput.flush()
.protected java.io.OutputStream
getOut()
Gets the output stream.int
write(java.nio.ByteBuffer src)
Overrides theOutput.write(ByteBuffer)
.
-
-
-
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.
-
getOut
protected java.io.OutputStream getOut()
Gets the output stream.- Returns:
- the output stream.
-
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.
-
-