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

      abstract long position() throws IOException
      Gets the current position in this stream.
      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
    • writeAll

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

      void writeAll(byte[] bytes, long position) throws IOException
      Writes all given bytes at a position.
      Parameters:
      bytes - data to write
      position - position in the stream
      Throws:
      IOException - if an I/O error occurs.