org.klomp.snark.web

## Class InclusiveByteRange

- java.lang.Object
- - org.klomp.snark.web.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$

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) long` | `first`
    `(package private) long` | `last`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InclusiveByteRange(long first, long last)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### first

          long first

    - #### last

          long last

  - ### Constructor Detail

    - #### InclusiveByteRange

          public InclusiveByteRange(long first,
                                    long last)

  - ### Method Detail

    - #### getFirst

          public long getFirst()

    - #### getFirst

          public long getFirst(long size)

    - #### getLast

          public long getLast()

    - #### getLast

          public long getLast(long size)

    - #### getSize

          public long getSize(long size)

    - #### satisfiableRanges

          public static List<InclusiveByteRange> satisfiableRanges(Enumeration<?> headers,
                                                                   long size)

      Parameters:
        `headers` - Enumeration of Range header fields.
        `size` - Size of the resource.
      Returns:
        List of satisfiable ranges

    - #### to416HeaderRangeString

          public static String to416HeaderRangeString(long size)

    - #### toHeaderRangeString

          public String toHeaderRangeString(long size)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`