Class ByteArrayOutputStream

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

    public class ByteArrayOutputStream
    extends OutputStream
    Very similar to the but this version is not thread safe and the resulting data is returned in a ByteSequence to avoid an extra byte[] allocation.
    • Constructor Detail

      • ByteArrayOutputStream

        public ByteArrayOutputStream()
      • ByteArrayOutputStream

        public ByteArrayOutputStream​(int capacity)
    • Method Detail

      • write

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

        public void reset()
      • toByteArray

        public byte[] toByteArray()
      • size

        public int size()
      • endsWith

        public boolean endsWith​(byte[] array)