Top Description Fields Constructors Methods
org.mortbay.jetty

public Class InclusiveByteRange

extends Object
Class Inheritance
Imports
java.util.Enumeration, .List, .StringTokenizer, org.mortbay.log.Log, org.mortbay.util.LazyList

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
Author
Helmut Hissen
Version
$version$

Field Summary

Modifier and TypeField and Description
pack-priv long
pack-priv long

Constructor Summary

AccessConstructor and Description
public
InclusiveByteRange(long first, long last)

Method Summary

Modifier and TypeMethod and Description
public long
public long
getFirst(long size)

public long
public long
getLast(long size)

public long
getSize(long size)

public static List<E>

Returns:

LazyList of satisfiable ranges
satisfiableRanges
(Enumeration<E>
Enumeration of Range header fields.
headers
,
long
Size of the resource.
size
)

public static String
public String
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

firstback to summary
pack-priv long first
lastback to summary
pack-priv long last

Constructor Detail

InclusiveByteRangeback to summary
public InclusiveByteRange(long first, long last)

Method Detail

getFirstback to summary
public long getFirst()
getFirstback to summary
public long getFirst(long size)
getLastback to summary
public long getLast()
getLastback to summary
public long getLast(long size)
getSizeback to summary
public long getSize(long size)
satisfiableRangesback to summary
public static List<E> satisfiableRanges(Enumeration<E> headers, long size)
Parameters
headers:Enumeration<E>

Enumeration of Range header fields.

size:long

Size of the resource.

Returns:List<E>

LazyList of satisfiable ranges

to416HeaderRangeStringback to summary
public static String to416HeaderRangeString(long size)
toHeaderRangeStringback to summary
public String toHeaderRangeString(long size)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object