public class InclusiveByteRange extends Object
parses the following types of byte ranges:
bytes=100-499
bytes=-300
bytes=100-
bytes=1-2,2-3,6-,-2
given an entity length, converts range to string
bytes 100-499/500
Based on RFC2616 3.12, 14.16, 14.35.1, 14.35.2| Modifier and Type | Field | Description |
|---|---|---|
(package private) long |
first |
|
(package private) long |
last |
| Constructor | Description |
|---|---|
InclusiveByteRange(long first,
long last) |
| Modifier and Type | Method | Description |
|---|---|---|
long |
getFirst() |
|
long |
getFirst(long size) |
|
long |
getLast() |
|
long |
getLast(long size) |
|
long |
getSize(long size) |
|
static List<InclusiveByteRange> |
satisfiableRanges(Enumeration<?> headers,
long size) |
|
static String |
to416HeaderRangeString(long size) |
|
String |
toHeaderRangeString(long size) |
|
String |
toString() |
public long getFirst()
public long getLast()
public static List<InclusiveByteRange> satisfiableRanges(Enumeration<?> headers, long size)
headers - Enumeration of Range header fields.size - Size of the resource.public long getFirst(long size)
public long getLast(long size)
public long getSize(long size)
public String toHeaderRangeString(long size)
public static String to416HeaderRangeString(long size)