Class ExposedByteArrayOutputStream

java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
io.datarouter.bytes.ExposedByteArrayOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class ExposedByteArrayOutputStream extends ByteArrayOutputStream
For converting from a ByteArrayOutputStream to a ByteArrayInputStream without making a copy of the data. Should be used carefully for performance-critical situations. Expected behavior: - populate the OutputStream - convert to InputStream using toInputStream() - drain the InputStream - optionally repeat by calling reset() on the OutputStream to avoid allocating
  • Constructor Details

    • ExposedByteArrayOutputStream

      public ExposedByteArrayOutputStream()
    • ExposedByteArrayOutputStream

      public ExposedByteArrayOutputStream(int initialCapacity)
  • Method Details