Class ServerFileBodyHandler.ByteRange
- java.lang.Object
-
- org.jboss.resteasy.reactive.server.providers.serialisers.ServerFileBodyHandler.ByteRange
-
- Enclosing class:
- ServerFileBodyHandler
public static class ServerFileBodyHandler.ByteRange extends Object
Represents a byte range for a range request- Author:
- Stuart Douglas NOTE: copied from Quarkus HTTP
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classServerFileBodyHandler.ByteRange.Range
-
Constructor Summary
Constructors Constructor Description ByteRange(List<ServerFileBodyHandler.ByteRange.Range> ranges)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetEnd(int range)Gets the end of the specified range segment, or the number of bytes if this is a suffix range segmentintgetRanges()longgetStart(int range)Gets the start of the specified range segment, of -1 if this is a suffix range segmentstatic ServerFileBodyHandler.ByteRangeparse(String rangeHeader)Attempts to parse a range request.
-
-
-
Constructor Detail
-
ByteRange
public ByteRange(List<ServerFileBodyHandler.ByteRange.Range> ranges)
-
-
Method Detail
-
getRanges
public int getRanges()
-
getStart
public long getStart(int range)
Gets the start of the specified range segment, of -1 if this is a suffix range segment- Parameters:
range- The range segment to get- Returns:
- The range start
-
getEnd
public long getEnd(int range)
Gets the end of the specified range segment, or the number of bytes if this is a suffix range segment- Parameters:
range- The range segment to get- Returns:
- The range end
-
parse
public static ServerFileBodyHandler.ByteRange parse(String rangeHeader)
Attempts to parse a range request. If the range request is invalid it will just return null so that it may be ignored.- Parameters:
rangeHeader- The range spec- Returns:
- A range spec, or null if the range header could not be parsed
-
-