Class InputStreamRangeWriter

java.lang.Object
org.eclipse.jetty.server.resource.InputStreamRangeWriter
All Implemented Interfaces:
Closeable, AutoCloseable, RangeWriter

public class InputStreamRangeWriter extends Object implements RangeWriter
Default Range Writer for InputStream
  • Field Details

  • Constructor Details

    • InputStreamRangeWriter

      public InputStreamRangeWriter(InputStreamRangeWriter.InputStreamSupplier inputStreamSupplier)
      Create InputStreamRangeWriter
      Parameters:
      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 Details

    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • writeTo

      public void writeTo(OutputStream outputStream, long skipTo, long length) throws 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:
      IOException