Interface BlobReadSession (2.52.2)

public interface BlobReadSession extends AutoCloseable, Closeable

A session for reading bytes from a Blob See Also: Storage#blobReadSession(BlobId, BlobSourceOption...), ReadProjectionConfigs

Implements

AutoCloseable, Closeable

Methods

<Projection>readAs(ReadProjectionConfig<Projection> config)

public abstract Projection <Projection>readAs(ReadProjectionConfig<Projection> config)

Read from this session as a specific Projection as dictated by the provided config See Also: ReadProjectionConfigs, ReadProjectionConfig

Parameter
Name Description
config ReadProjectionConfig<Projection>
Returns
Type Description
Projection

close()

public abstract void close()

Close this session and any Projections produced by <xref uid="com.google.cloud.storage.BlobReadSession.<Projection>readAs(com.google.cloud.storage.ReadProjectionConfig<Projection>)" data-throw-if-not-resolved="false">#readAs(ReadProjectionConfig).

If a projection is not fully consumed/resolved it will be transitioned to a failed state.

This method MUST be called to ensure cleanup of any inflight buffers, and to avoid a memory leak.

Exceptions
Type Description
IOException

getBlobInfo()

public abstract BlobInfo getBlobInfo()

The resolved metadata for the object being read

Returns
Type Description
BlobInfo