Class InputStreamRangeWriter
- java.lang.Object
-
- org.eclipse.jetty.server.resource.InputStreamRangeWriter
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,RangeWriter
public class InputStreamRangeWriter extends java.lang.Object implements RangeWriter
Default Range Writer for InputStream
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceInputStreamRangeWriter.InputStreamSupplier
-
Field Summary
Fields Modifier and Type Field Description static intNO_PROGRESS_LIMIT
-
Constructor Summary
Constructors Constructor Description InputStreamRangeWriter(InputStreamRangeWriter.InputStreamSupplier inputStreamSupplier)Create InputStremRangeWriter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidwriteTo(java.io.OutputStream outputStream, long skipTo, long length)Write the specific range (start, size) to the outputStream.
-
-
-
Field Detail
-
NO_PROGRESS_LIMIT
public static final int NO_PROGRESS_LIMIT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InputStreamRangeWriter
public InputStreamRangeWriter(InputStreamRangeWriter.InputStreamSupplier inputStreamSupplier)
Create InputStremRangeWriter- 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 Detail
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
writeTo
public void writeTo(java.io.OutputStream outputStream, long skipTo, long length) throws java.io.IOExceptionDescription copied from interface:RangeWriterWrite the specific range (start, size) to the outputStream.- Specified by:
writeToin 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:
java.io.IOException
-
-