Class BufferOutputStream

java.lang.Object
java.io.OutputStream
org.fusesource.hawtbuf.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.
  • Field Details

    • buffer

      byte[] buffer
    • offset

      int offset
    • limit

      int limit
    • pos

      int pos
  • Constructor Details

    • BufferOutputStream

      public BufferOutputStream(int size)
    • BufferOutputStream

      public BufferOutputStream(byte[] buffer)
    • BufferOutputStream

      public BufferOutputStream(Buffer data)
  • Method Details