Class SeekableByteChannelRangeWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, RangeWriter

    public class SeekableByteChannelRangeWriter
    extends java.lang.Object
    implements RangeWriter
    • Field Detail

      • bufSize

        private final int bufSize
      • buffer

        private final java.nio.ByteBuffer buffer
      • channel

        private java.nio.channels.SeekableByteChannel channel
      • pos

        private long pos
      • defaultSeekMode

        private boolean defaultSeekMode
    • 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
        Throws:
        java.io.IOException
      • writeTo

        public void writeTo​(java.io.OutputStream outputStream,
                            long skipTo,
                            long length)
                     throws java.io.IOException
        Description copied from interface: RangeWriter
        Write the specific range (start, size) to the outputStream.
        Specified by:
        writeTo in interface RangeWriter
        Parameters:
        outputStream - the stream to write to
        skipTo - the offset / skip-to / seek-to / position in the resource to start the write from
        length - the size of the section to write
        Throws:
        java.io.IOException
      • skipTo

        private void skipTo​(long skipTo)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • fallbackSkipTo

        private void fallbackSkipTo​(long skipTo)
                             throws java.io.IOException
        Throws:
        java.io.IOException