Class ReadAsSeekableChannel (2.52.2)

public final class ReadAsSeekableChannel extends ReadProjectionConfig<SeekableByteChannel>

Read from the object as a SeekableByteChannel

The returned channel will be non-blocking for all read calls. If bytes have not yet asynchronously been delivered from Google Cloud Storage the method will return rather than waiting for the bytes to arrive.

The resulting SeekableByteChannel MUST be close()ed to avoid leaking memory

Instances of this class are immutable and thread safe. See Also: <xref uid="com.google.cloud.storage.BlobReadSession.<Projection>readAs(com.google.cloud.storage.ReadProjectionConfig<Projection>)" data-throw-if-not-resolved="false">BlobReadSession#readAs(ReadProjectionConfig), ReadProjectionConfigs#asSeekableChannel(), SeekableByteChannel

Inheritance

Object > ReadProjectionConfig > ReadAsSeekableChannel

Methods

equals(Object o)

public boolean equals(Object o)
Parameter
Name Description
o Object
Returns
Type Description
boolean
Overrides

getRangeSpecFunction()

public RangeSpecFunction getRangeSpecFunction()

Get the RangeSpecFunction this instance will use to generate RangeSpecs for reading from an object.

Default: RangeSpecFunction#linearExponential()

Returns
Type Description
RangeSpecFunction

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

toString()

public String toString()
Returns
Type Description
String
Overrides

withRangeSpecFunction(RangeSpecFunction rangeSpecFunction)

public ReadAsSeekableChannel withRangeSpecFunction(RangeSpecFunction rangeSpecFunction)

Return an instance with the rangeSpecFunction set to the specified value.

Default: RangeSpecFunction#linearExponential() See Also: #getRangeSpecFunction()

Parameter
Name Description
rangeSpecFunction RangeSpecFunction

The RangeSpecFunction to use to generate RangeSpecs for reading from an object.

Returns
Type Description
ReadAsSeekableChannel