public class RangeResource extends Resource
parseRange() to prepare internal state for rendering.
The method will throw RangeNotSatisfiableException if the requested
byte ranges cannot be replayed with the base Resource.
RangeResource currently only works with:
Content-Length, or a valid 206 capture
with single range (i.e. no support for multipart/byteranges)
HttpHeaderOperation.parseRanges(String)| Constructor and Description |
|---|
RangeResource(Resource origResource,
long[][] requestedRanges)
Initialize with base Resource and requested ranges.
|
| Modifier and Type | Method and Description |
|---|---|
protected long[] |
availableRange()
Look at resource HTTP header fields and determine the byte range available.
|
void |
close() |
Map<String,String> |
getHttpHeaders()
Assumes an HTTP response - return the HTTP headers, not including the
HTTP Message header
|
long |
getRecordLength() |
int |
getStatusCode()
Assumes an HTTP resource - return the HTTP response code
|
void |
parseRange()
Prepare response for requested range.
|
available, getHeader, getRefersToDate, getRefersToTargetURI, mark, markSupported, parseHeaders, read, read, read, reset, setChunkedEncoding, setInputStream, skippublic RangeResource(Resource origResource, long[][] requestedRanges)
origResource - base resourcerequestedRanges - requested rangeHttpHeaderOperation.parseRanges(String)public void parseRange()
throws RangeNotSatisfiableException,
IOException
RangeNotSatisfiableException - base Resource either does not have
enough data to fulfill the request, or have invalid header field.IOExceptionprotected long[] availableRange()
null for multipart/byteranges
response.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ResourceIOExceptionpublic Map<String,String> getHttpHeaders()
ResourcegetHttpHeaders in class Resourcepublic long getRecordLength()
getRecordLength in class Resourcepublic int getStatusCode()
ResourcegetStatusCode in class ResourceCopyright © 2005–2017 IIPC. All rights reserved.