public final class HttpRange extends Object
Constructor and Description |
---|
HttpRange(long offset)
Creates an instance of
HttpRange . |
HttpRange(long offset,
Long length)
Creates an instance of
HttpRange . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Long |
getLength()
Gets the length of the range.
|
long |
getOffset()
Gets the offset of the range.
|
int |
hashCode() |
String |
toString()
Gets the string representation of the range.
|
public HttpRange(long offset)
HttpRange
.
This creates a range which has an unbounded length starting at the specified offset
.
offset
- The offset to begin the range.IllegalArgumentException
- If offset
is less than 0.public HttpRange(long offset, Long length)
HttpRange
.offset
- The offset to begin the range.length
- The length of the range.IllegalArgumentException
- If offset
is less than 0 or length
is non-null and is less than
or equal to 0.public long getOffset()
public Long getLength()
If the length is null the range continues to the end of the HTTP resource.
public String toString()
If length is null the returned string will be "bytes=<offset>-"
, if length is not null the returned
string will be "bytes=<offset>-<offset + length - 1>"
.
Copyright © 2021 Microsoft Corporation. All rights reserved.