Class Range

java.lang.Object
ch.tocco.nice2.dms.impl.publish.Range

public abstract class Range extends Object
Utility class for Range header values. See http://tools.ietf.org/html/rfc2616#section-14.35
  • Method Details

    • rangeLength

      public int rangeLength(int completeLength)
    • toHeaderValue

      public String toHeaderValue(int totalLength)
    • firstPos

      public abstract int firstPos(int totalLength)
    • lastPos

      public abstract int lastPos(int totalLength)
    • range

      public static Range range(int firstPos, int lastPos)
    • fromStart

      public static Range fromStart(int firstPos)
    • lastbytes

      public static Range lastbytes(int suffix)
    • fromEnumeration

      public static Optional<List<Range>> fromEnumeration(Enumeration headerValue)
    • fromString

      public static List<Range> fromString(String headerValue)
      Creates a `Range` object from a header value like "bytes=100-300".