Class FileRange
java.lang.Object
com.azure.storage.file.datalake.models.FileRange
This is a representation of a range of bytes on a file, typically used during a download operation. This type is
immutable to ensure thread-safety of requests, so changing the values for a different operation requires construction
of a new object. Passing null as a FileRange value will default to the entire range of the file.
-
Constructor Summary
ConstructorDescriptionFileRange
(long offset) Specifies the download operation to start from the offset position (zero-based) and download the rest of the entire file to the end.Specifies the download operation to start from the offset position (zero-based) and download the count number of bytes. -
Method Summary
-
Constructor Details
-
FileRange
public FileRange(long offset) Specifies the download operation to start from the offset position (zero-based) and download the rest of the entire file to the end.- Parameters:
offset
- the zero-based position to start downloading- Throws:
IllegalArgumentException
- Ifoffset
is less than0
.
-
FileRange
Specifies the download operation to start from the offset position (zero-based) and download the count number of bytes.- Parameters:
offset
- the zero-based position to start downloadingcount
- the number of bytes to download- Throws:
IllegalArgumentException
- Ifoffset
orcount
is less than0
.
-
-
Method Details
-
getOffset
public long getOffset()The start of the range. Must be greater than or equal to 0.- Returns:
- the offset for the range
-
getCount
How many bytes to include in the range. Must be greater than or equal to 0 if specified.- Returns:
- the number bytes to include in the range
-
toString
-
toHeaderValue
- Returns:
toString()
ifcount
isn'tnull
oroffset
isn't 0, otherwise null.
-