FileRange Class
- java.
lang. Object - com.
azure. storage. file. datalake. models. FileRange
- com.
public final class 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
Constructor | Description |
---|---|
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. |
FileRange(long offset, Long count) |
Specifies the download operation to start from the offset position (zero-based) and download the count number of bytes. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Long |
getCount()
How many bytes to include in the range. |
long |
getOffset()
The start of the range. |
String | toHeaderValue() |
String | toString() |
Methods inherited from java.lang.Object
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:
FileRange
public FileRange(long offset, Long count)
Specifies the download operation to start from the offset position (zero-based) and download the count number of bytes.
Parameters:
Method Details
getCount
public Long getCount()
How many bytes to include in the range. Must be greater than or equal to 0 if specified.
Returns:
getOffset
public long getOffset()
The start of the range. Must be greater than or equal to 0.
Returns:
toHeaderValue
public String toHeaderValue()
Returns:
toString
public String toString()
Overrides:
FileRange.toString()Returns:
String
compliant with the format of the Azure Storage x-ms-range and Range headers.Applies to
Azure SDK for Java