Package org.cryptacular.io
Class DirectByteArrayOutputStream
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
org.cryptacular.io.DirectByteArrayOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Extends
ByteArrayOutputStream
by allowing direct access to the internal byte buffer.- Author:
- Middleware Services
-
Field Summary
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance with a buffer of the default size.DirectByteArrayOutputStream
(int capacity) Creates a new instance with a buffer of the given initial capacity. -
Method Summary
Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, toString, write, write, writeBytes, writeTo
Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
Constructor Details
-
DirectByteArrayOutputStream
public DirectByteArrayOutputStream()Creates a new instance with a buffer of the default size. -
DirectByteArrayOutputStream
public DirectByteArrayOutputStream(int capacity) Creates a new instance with a buffer of the given initial capacity.- Parameters:
capacity
- Initial capacity of internal buffer.
-
-
Method Details
-
getBuffer
public byte[] getBuffer()Gets the internal byte buffer.- Returns:
- Internal buffer that holds written bytes.
-