Class RangeSpec (2.79.0)
Stay organized with collections
Save and categorize content based on your preferences.
public abstract class RangeSpec
Defines a range with a begin offset and optional maximum length.
Inheritance
Object >
RangeSpec
Static Methods
all()
public static @NonNull RangeSpec all()
A RangeSpec that represents to read from 0 to EOF
| Returns |
| Type |
Description |
@org.checkerframework.checker.nullness.qual.NonNull com.google.cloud.storage.RangeSpec |
|
beginAt(long begin)
public static @NonNull RangeSpec beginAt(long begin)
Create a new RangeSpec with the provided begin.
| Parameter |
| Name |
Description |
begin |
long
The beginning of the range, must be >= 0
|
| Returns |
| Type |
Description |
@org.checkerframework.checker.nullness.qual.NonNull com.google.cloud.storage.RangeSpec |
|
of(long begin, long maxLength)
public static @NonNull RangeSpec of(long begin, long maxLength)
Create a new RangeSpec with the provided begin and maxLength.
| Parameters |
| Name |
Description |
begin |
long
The beginning of the range, must be >= 0
|
maxLength |
long
The max length of the range, must be >= 0. 0 means no limit.
|
| Returns |
| Type |
Description |
@org.checkerframework.checker.nullness.qual.NonNull com.google.cloud.storage.RangeSpec |
|
Methods
begin()
public abstract long begin()
The beginning of the range.
| Returns |
| Type |
Description |
long |
|
equals(Object o)
public abstract boolean equals(Object o)
| Parameter |
| Name |
Description |
o |
Object
|
Overrides
hashCode()
public abstract int hashCode()
| Returns |
| Type |
Description |
int |
|
Overrides
maxLength()
public abstract OptionalLong maxLength()
The max length of the range if defined.
See Also: RangeSpecWithMaxLength
toString()
public abstract String toString()
| Returns |
| Type |
Description |
String |
|
Overrides
withMaxLength(long maxLength)
public abstract @NonNull RangeSpec withMaxLength(long maxLength)
Create a new instance of RangeSpec keeping this.begin() and with
maxLength as its new maxLength.
| Parameter |
| Name |
Description |
maxLength |
long
|
| Returns |
| Type |
Description |
@org.checkerframework.checker.nullness.qual.NonNull com.google.cloud.storage.RangeSpec |
|
[null,null,["Last updated 2026-11-19 UTC."],[],[]]