Class RandomAccessOutputStream

java.lang.Object
java.io.OutputStream
org.apache.commons.compress.archivers.zip.RandomAccessOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
Direct Known Subclasses:
FileRandomAccessOutputStream, SeekableChannelRandomAccessOutputStream, ZipSplitOutputStream

abstract class RandomAccessOutputStream extends OutputStream
Abstraction over OutputStream which also allows random access writes.
  • Constructor Details

    • RandomAccessOutputStream

      RandomAccessOutputStream()
  • Method Details

    • position

      public abstract long position() throws IOException
      Provides current position in output.
      Returns:
      current position.
      Throws:
      IOException - if an I/O error occurs
    • write

      public void write(int b) throws IOException
      Specified by:
      write in class OutputStream
      Throws:
      IOException
    • writeFully

      abstract void writeFully(byte[] b, int off, int len, long position) throws IOException
      Writes given data to specific position.
      Parameters:
      b - data to write
      off - offset of the start of data in param b
      len - the length of data to write
      position - position in the stream
      Throws:
      IOException - if an I/O error occurs.
    • writeFully

      public void writeFully(byte[] b, long position) throws IOException
      Writes given data to specific position.
      Parameters:
      b - data to write
      position - position in the stream
      Throws:
      IOException - if an I/O error occurs.