Class InputStreamRangeWriter

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

    public class InputStreamRangeWriter
    extends java.lang.Object
    implements RangeWriter
    Default Range Writer for InputStream
    • Constructor Detail

      • InputStreamRangeWriter

        public InputStreamRangeWriter​(InputStreamRangeWriter.InputStreamSupplier inputStreamSupplier)
        Create InputStremRangeWriter
        inputStreamSupplier - Supplier of the InputStream. If the stream needs to be regenerated, such as the next requested range being before the current position, then the current InputStream is closed and a new one obtained from this supplier.
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface
      • writeTo

        public void writeTo​( outputStream,
                            long skipTo,
                            long length)
        Description copied from interface: RangeWriter
        Write the specific range (start, size) to the outputStream.
        Specified by:
        writeTo in interface RangeWriter
        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