org.mortbay.jetty
Class InclusiveByteRange
java.lang.Object
org.mortbay.jetty.InclusiveByteRange
public class InclusiveByteRange
- extends Object
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$
- Author:
- Helmut Hissen
InclusiveByteRange
public InclusiveByteRange(long first,
long last)
getFirst
public long getFirst()
getLast
public long getLast()
satisfiableRanges
public static List satisfiableRanges(Enumeration headers,
long size)
- Parameters:
headers
- Enumeration of Range header fields.size
- Size of the resource.
- Returns:
- LazyList of satisfiable ranges
getFirst
public long getFirst(long size)
getLast
public long getLast(long size)
getSize
public long getSize(long size)
toHeaderRangeString
public String toHeaderRangeString(long size)
to416HeaderRangeString
public static String to416HeaderRangeString(long size)
toString
public String toString()
- Overrides:
toString
in class Object