public class RangeResponse extends Object
Constructor and Description |
---|
RangeResponse(int startIndex,
Integer endIndex,
int totalFileLength) |
Modifier and Type | Method and Description |
---|---|
int |
calculateContentLength()
Calculates the "Content-Length" response header value.
|
String |
calculateContentRange()
Calculates the "Content-Range" response header value.
|
Integer |
getEndIndex() |
int |
getStartIndex() |
String |
toString() |
public RangeResponse(int startIndex, Integer endIndex, int totalFileLength)
public int getStartIndex()
public Integer getEndIndex()
public int calculateContentLength()
That is, the number of bytes we will return, based on the requested range and also the actual length of the file. See https://tools.ietf.org/html/rfc7233#section-4.1
public String calculateContentRange()
eg "Content-Range: bytes 21010-47021/47022" See https://tools.ietf.org/html/rfc7233#section-4.1
Copyright © 2002-2021 Atlassian. All Rights Reserved.