Class BufferOutputStream

java.lang.Object
java.io.OutputStream
org.apache.activemq.protobuf.BufferOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public final class BufferOutputStream extends OutputStream
Very similar to the java.io.ByteArrayOutputStream but this version is not thread safe and the resulting data is returned in a Buffer to avoid an extra byte[] allocation. It also does not re-grow it's internal buffer.
  • Constructor Details

    • BufferOutputStream

      public BufferOutputStream(int size)
    • BufferOutputStream

      public BufferOutputStream(byte[] buffer)
    • BufferOutputStream

      public BufferOutputStream(Buffer data)
  • Method Details