Package com.azure.core.http
Class HttpRange
java.lang.Object
com.azure.core.http.HttpRange
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
HttpRange
public HttpRange(long offset) Creates an instance ofHttpRange.This creates a range which has an unbounded length starting at the specified
offset.- Parameters:
offset- The offset to begin the range.- Throws:
IllegalArgumentException- Ifoffsetis less than 0.
-
HttpRange
Creates an instance ofHttpRange.- Parameters:
offset- The offset to begin the range.length- The length of the range.- Throws:
IllegalArgumentException- Ifoffsetis less than 0 orlengthis non-null and is less than or equal to 0.
-
-
Method Details
-
getOffset
public long getOffset()Gets the offset of the range.- Returns:
- Offset of the range.
-
getLength
Gets the length of the range.If the length is null the range continues to the end of the HTTP resource.
- Returns:
- Length of the range or null if range continues to the end of the HTTP resource.
-
hashCode
public int hashCode() -
equals
-
toString
Gets the string representation of the range.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>".
-