Class ByteArrayDataOutputStream

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

    @ParametersAreNonnullByDefault
    public class ByteArrayDataOutputStream
    extends java.io.OutputStream
    implements SeekableStream, FinishableStream
    Output stream for byte array data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      long finish()
      Reads remaining data and returns size of all data processed by this stream.
      long getProcessedSize()
      Returns size of data processed so far.
      long getStreamSize()
      Returns length of the stream.
      void seek​(long position)
      Moves position in the stream to given position from the start of the stream.
      void write​(byte[] input, int off, int len)  
      void write​(int value)  
      • Methods inherited from class java.io.OutputStream

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

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

      • write

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

        public void write​(byte[] input,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • seek

        public void seek​(long position)
                  throws java.io.IOException
        Description copied from interface: SeekableStream
        Moves position in the stream to given position from the start of the stream.
        Specified by:
        seek in interface SeekableStream
        Parameters:
        position - target position
        Throws:
        java.io.IOException - if input/output error
      • getStreamSize

        public long getStreamSize()
        Description copied from interface: SeekableStream
        Returns length of the stream.
        Specified by:
        getStreamSize in interface SeekableStream
        Returns:
        length of the stream in bytes, -1 if unable to determine
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream
        Throws:
        java.io.IOException
      • finish

        public long finish()
                    throws java.io.IOException
        Description copied from interface: FinishableStream
        Reads remaining data and returns size of all data processed by this stream.
        Specified by:
        finish in interface FinishableStream
        Returns:
        size of data in bytes
        Throws:
        java.io.IOException - if input/output error occurs