Package com.google.cloud.storage
Class RangeSpec
java.lang.Object
com.google.cloud.storage.RangeSpec
Defines a range with a begin offset and optional maximum length.
- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull RangeSpecall()A RangeSpec that represents to read from0toEOFabstract longbegin()The beginning of the range.static @NonNull RangeSpecbeginAt(long begin) Create a new RangeSpec with the providedbegin.abstract booleanabstract inthashCode()abstract OptionalLongThe max length of the range if defined.static @NonNull RangeSpecof(long begin, long maxLength) Create a new RangeSpec with the providedbeginandmaxLength.abstract StringtoString()abstract @NonNull RangeSpecwithMaxLength(long maxLength)
-
Method Details
-
begin
@BetaApi public abstract long begin()The beginning of the range.- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
-
maxLength
The max length of the range if defined.- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
- See Also:
-
RangeSpec.RangeSpecWithMaxLength
-
withMaxLength
- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
-
equals
-
hashCode
public abstract int hashCode() -
toString
-
beginAt
Create a new RangeSpec with the providedbegin.- Parameters:
begin- The beginning of the range, must be >= 0- Throws:
IllegalArgumentException- if begin is < 0- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
-
of
Create a new RangeSpec with the providedbeginandmaxLength.- Parameters:
begin- The beginning of the range, must be >= 0maxLength- The max length of the range, must be >= 0. 0 means no limit.- Throws:
IllegalArgumentException- if begin is < 0, or if maxLength is < 0- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
-
all
A RangeSpec that represents to read from0toEOF- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
-