Class InclusiveByteRange
java.lang.Object
org.eclipse.jetty.server.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/500Based on RFC2616 3.12, 14.16, 14.35.1, 14.35.2
And yes the spec does strangely say that while 10-20, is bytes 10 to 20 and 10- is bytes 10 until the end that -20 IS NOT bytes 0-20, but the last 20 bytes of the content.
- Version:
- $version$
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidbooleanlonggetFirst()longgetLast()longgetSize()inthashCode()private booleanoverlaps(InclusiveByteRange range) static List<InclusiveByteRange> satisfiableRanges(Enumeration<String> headers, long size) static Stringto416HeaderRangeString(long size) toHeaderRangeString(long size) toString()
-
Field Details
-
LOG
-
first
private long first -
last
private long last
-
-
Constructor Details
-
InclusiveByteRange
public InclusiveByteRange(long first, long last)
-
-
Method Details
-
getFirst
public long getFirst() -
getLast
public long getLast() -
coalesce
-
overlaps
-
getSize
public long getSize() -
toHeaderRangeString
-
hashCode
-
equals
-
toString
-
satisfiableRanges
- Parameters:
headers- Enumeration of Range header fields.size- Size of the resource.- Returns:
- List of satisfiable ranges
-
to416HeaderRangeString
-