Class FastByteArrayOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    class FastByteArrayOutputStream
    extends java.io.OutputStream
    Like ByteArrayOutputStream, but has some performance benefit, because it's not thread safe.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte[] bytes  
      private int count  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getBytesWritten()  
      byte[] toByteArray()  
      void write​(int value)  
      • Methods inherited from class java.io.OutputStream

        close, flush, write, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • bytes

        private final byte[] bytes
      • count

        private int count
    • Constructor Detail

      • FastByteArrayOutputStream

        FastByteArrayOutputStream​(int length)
    • Method Detail

      • write

        public void write​(int value)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • toByteArray

        public byte[] toByteArray()
      • getBytesWritten

        public int getBytesWritten()