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 aOutputStreamobject and wraps it asOutputobject acceptable byCryptoOutputStreamas the output target.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]bufprivate intbufferSizeprivate java.io.OutputStreamout
-
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 voidclose()Overrides theOutput.close().voidflush()Overrides theOutput.flush().protected java.io.OutputStreamgetOut()Gets the output stream.intwrite(java.nio.ByteBuffer src)Overrides theOutput.write(ByteBuffer).
-
-
-
Method Detail
-
close
public void close() throws java.io.IOExceptionOverrides theOutput.close(). Closes this output and releases any system resources associated with the under layer output.
-
flush
public void flush() throws java.io.IOExceptionOverrides 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.IOExceptionOverrides theOutput.write(ByteBuffer). Writes a sequence of bytes to this output from the given buffer.
-
-