Class SeekableChannelRandomAccessOutputStream

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.nio.channels.SeekableByteChannel channel  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      long position()
      Provides current position in output.
      void write​(byte[] b, int off, int len)  
      void writeFully​(byte[] b, int off, int len, long position)
      Writes given data to specific position.
      • 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
    • Field Detail

      • channel

        private final java.nio.channels.SeekableByteChannel channel
    • Constructor Detail

      • SeekableChannelRandomAccessOutputStream

        SeekableChannelRandomAccessOutputStream​(java.nio.channels.SeekableByteChannel channel)
    • Method Detail

      • 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
      • position

        public long position()
                      throws java.io.IOException
        Description copied from class: RandomAccessOutputStream
        Provides current position in output.
        Specified by:
        position in class RandomAccessOutputStream
        Returns:
        current position.
        Throws:
        java.io.IOException - if an I/O error occurs
      • write

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

        public void writeFully​(byte[] b,
                               int off,
                               int len,
                               long position)
                        throws java.io.IOException
        Description copied from class: RandomAccessOutputStream
        Writes given data to specific position.
        Specified by:
        writeFully in class RandomAccessOutputStream
        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:
        java.io.IOException - if an I/O error occurs.