Package org.klomp.snark.web
Class InclusiveByteRange
java.lang.Object
org.klomp.snark.web.InclusiveByteRange
Byte range inclusive of end points.
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- Version:
- $version$
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetFirst()longgetFirst(long size) longgetLast()longgetLast(long size) longgetSize(long size) static List<InclusiveByteRange>satisfiableRanges(Enumeration<?> headers, long size) static Stringto416HeaderRangeString(long size) toHeaderRangeString(long size) toString()
-
Field Details
-
first
long first -
last
long last
-
-
Constructor Details
-
InclusiveByteRange
public InclusiveByteRange(long first, long last)
-
-
Method Details
-
getFirst
public long getFirst() -
getLast
public long getLast() -
satisfiableRanges
- Parameters:
headers- Enumeration of Range header fields.size- Size of the resource.- Returns:
- List of satisfiable ranges
-
getFirst
public long getFirst(long size) -
getLast
public long getLast(long size) -
getSize
public long getSize(long size) -
toHeaderRangeString
-
to416HeaderRangeString
-
toString
-