public class ByteRanges
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static ByteRange |
fromLastNBytes(long lastNBytes)
Construct a range that represents the last N bytes of an object.
|
static ByteRange |
fromOffsetRange(long startOffset,
long endOffset)
Construct a range from a start offset to an end offset.
|
static ByteRange |
fromStartOffset(long startOffset)
Construct a range from a start offset to the end of an object.
|
public static ByteRange fromOffsetRange(long startOffset, long endOffset)
startOffset
- the (inclusive) start byte offset.endOffset
- the (inclusive) end byte offset.ByteRange
with the specified offsets.java.lang.IllegalArgumentException
- if the start offset is less than 0, or the end offset is less than the start.public static ByteRange fromStartOffset(long startOffset)
startOffset
- The (inclusive) start byte offset.ByteRange
with the specified start offset.java.lang.IllegalArgumentException
- if the start offset is less than 0public static ByteRange fromLastNBytes(long lastNBytes)
lastNBytes
- the number of bytes to read from the end of an object.ByteRange
representing the last N bytes of an objects.java.lang.IllegalArgumentException
- if the number of bytes to read is less than or equal to 0.