BYTES_RANGE
Constructor and Description |
---|
NoByteRange(long contentLength) |
Modifier and Type | Method and Description |
---|---|
ByteRange |
apply(Context ctx)
For partial request this method set the following byte range response headers:
- Accept-Ranges
- Content-Range
- Content-Length
For not satisfiable requests:
- Throws a
StatusCode.REQUESTED_RANGE_NOT_SATISFIABLE
Otherwise this method does nothing. |
InputStream |
apply(InputStream input)
For partial requests this method generates a new truncated input stream.
|
long |
getContentLength()
New content length.
|
String |
getContentRange()
Value for
Content-Range response header. |
long |
getEnd()
End range or
-1 . |
long |
getStart()
Start range or
-1 . |
StatusCode |
getStatusCode()
For partial requests this method returns
StatusCode.PARTIAL_CONTENT . |
public long getStart()
ByteRange
-1
.public long getEnd()
ByteRange
-1
.public long getContentLength()
ByteRange
getContentLength
in interface ByteRange
@Nonnull public StatusCode getStatusCode()
ByteRange
StatusCode.PARTIAL_CONTENT
.
For not satisfiable requests this returns StatusCode.REQUESTED_RANGE_NOT_SATISFIABLE
..
Otherwise just returns StatusCode.OK
.getStatusCode
in interface ByteRange
@Nonnull public String getContentRange()
ByteRange
Content-Range
response header.getContentRange
in interface ByteRange
Content-Range
response header.@Nonnull public ByteRange apply(@Nonnull Context ctx)
ByteRange
StatusCode.REQUESTED_RANGE_NOT_SATISFIABLE
Otherwise this method does nothing.@Nonnull public InputStream apply(@Nonnull InputStream input) throws IOException
ByteRange
apply
in interface ByteRange
input
- Input stream.IOException
- When truncation fails.Copyright © 2022. All rights reserved.