Class Range


  • public class Range
    extends Object
    Range header parsing logic
    Author:
    awoods, whikloj
    • Constructor Detail

      • Range

        protected Range​(long start)
        Left-bounded range
        Parameters:
        start - the start
    • Method Detail

      • hasRange

        protected boolean hasRange()
        Does this range actually impose limits
        Returns:
        true if the range imposes limits
      • size

        protected long size()
        Length contained in the range
        Returns:
        length of the range
      • start

        protected long start()
        Start of the range
        Returns:
        start of the range, or -1 if no start was specified
      • end

        protected long end()
        End of the range
        Returns:
        end of the range
      • convert

        public static Range convert​(String source)
        Convert an HTTP Range header to a Range object
        Parameters:
        source - the source
        Returns:
        range object
      • rangeOfLength

        public Range.RangeOfLength rangeOfLength​(long length)
        Create a range object with start and end bytes based on the length of the content.
        Parameters:
        length - the length of the content
        Returns:
        a range of length object