Class DirectByteArrayOutputStream

java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
org.cryptacular.io.DirectByteArrayOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class DirectByteArrayOutputStream extends ByteArrayOutputStream
Extends ByteArrayOutputStream by allowing direct access to the internal byte buffer.
Author:
Middleware Services
  • 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.