Class InputStreamRangeWriter
java.lang.Object
org.eclipse.jetty.server.resource.InputStreamRangeWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
,RangeWriter
Default Range Writer for InputStream
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionInputStreamRangeWriter
(InputStreamRangeWriter.InputStreamSupplier inputStreamSupplier) Create InputStreamRangeWriter -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
writeTo
(OutputStream outputStream, long skipTo, long length) Write the specific range (start, size) to the outputStream.
-
Field Details
-
NO_PROGRESS_LIMIT
public static final int NO_PROGRESS_LIMIT- See Also:
-
-
Constructor Details
-
InputStreamRangeWriter
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
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
writeTo
Description copied from interface:RangeWriter
Write the specific range (start, size) to the outputStream.- Specified by:
writeTo
in interfaceRangeWriter
- Parameters:
outputStream
- the stream to write toskipTo
- the offset / skip-to / seek-to / position in the resource to start the write fromlength
- the size of the section to write- Throws:
IOException
-