Class ByteArrayOutputStreamWithPos

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

    @Internal
    public class ByteArrayOutputStreamWithPos
    extends OutputStream
    Un-synchronized stream similar to Java's ByteArrayOutputStream that also exposes the current position.
    • Field Detail

      • buffer

        protected byte[] buffer
      • count

        protected int count
    • Constructor Detail

      • ByteArrayOutputStreamWithPos

        public ByteArrayOutputStreamWithPos()
      • ByteArrayOutputStreamWithPos

        public ByteArrayOutputStreamWithPos​(int size)
    • Method Detail

      • write

        public void write​(byte[] b,
                          int off,
                          int len)
        Overrides:
        write in class OutputStream
      • reset

        public void reset()
      • toByteArray

        public byte[] toByteArray()
      • size

        public int size()
      • getPosition

        public int getPosition()
      • setPosition

        public void setPosition​(int position)
      • getBuf

        public byte[] getBuf()