Class COSWriterObjectStream.DirectAccessByteArrayOutputStream

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

    private class COSWriterObjectStream.DirectAccessByteArrayOutputStream
    extends java.io.ByteArrayOutputStream
    Reuse the underlying byte array instead of copying it. This is a private class as reusing the byte array may have some unwanted side effects.
    • Field Summary

      • Fields inherited from class java.io.ByteArrayOutputStream

        buf, count
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getRawData()
      Gets the underlying byte array.
      • Methods inherited from class java.io.ByteArrayOutputStream

        close, reset, size, toByteArray, toString, toString, toString, write, write, writeTo
      • Methods inherited from class java.io.OutputStream

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

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DirectAccessByteArrayOutputStream

        private DirectAccessByteArrayOutputStream()
    • Method Detail

      • getRawData

        public byte[] getRawData()
        Gets the underlying byte array. It is most likely bigger than the real size of the stream, so that you have to take the size of the stream into account when accessing the data.
        Returns:
        the underlying byte array.