Class FastByteArrayOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class FastByteArrayOutputStream
    extends java.io.ByteArrayOutputStream
    An byte array output stream that allows direct access to the byte array.
    Version:
    $Revision: 1.4 $
    Author:
    Ben Litchfield
    • Field Summary

      • Fields inherited from class java.io.ByteArrayOutputStream

        buf, count
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getByteArray()
      This will get the underlying byte array.
      • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • FastByteArrayOutputStream

        public FastByteArrayOutputStream​(int size)
        Constructor.
        Parameters:
        size - An initial size of the stream.
    • Method Detail

      • getByteArray

        public byte[] getByteArray()
        This will get the underlying byte array.
        Returns:
        The underlying byte array at this moment in time.