Class ReadProjectionConfigs (2.52.3)

public final class ReadProjectionConfigs

Factory class to select ReadProjectionConfigs.

There are multiple projections which can be used to access the content of a BlobInfo in Google Cloud Storage. See Also: Storage#blobReadSession(BlobId, BlobSourceOption...), BlobReadSession, ReadProjectionConfig

Inheritance

java.lang.Object > ReadProjectionConfigs

Static Methods

asChannel()

public static ReadAsChannel asChannel()

Read a range as a non-blocking ScatteringByteChannel.

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 ScatteringByteChannel MUST be close()ed to avoid leaking memory See Also: ReadAsChannel, ScatteringByteChannel

Returns
Type Description
ReadAsChannel

asFutureByteString()

public static ReadAsFutureByteString asFutureByteString()

Read a range of bytes as an ApiFuture<DisposableByteString>

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

The entire range will be accumulated in memory before the future will resolve.

If you do not want the entire range accumulated in memory, please use one of the other ReadProjectionConfigs available. See Also: com.google.protobuf.ByteString, ApiFuture

Returns
Type Description
ReadAsFutureByteString

asFutureBytes()

public static ReadAsFutureBytes asFutureBytes()

Read a range of bytes as an ApiFuture<byte[]>

The entire range will be accumulated in memory before the future will resolve.

If you do not want the entire range accumulated in memory, please use one of the other ReadProjectionConfigs available. See Also: ApiFuture

Returns
Type Description
ReadAsFutureBytes

asSeekableChannel()

public static ReadAsSeekableChannel asSeekableChannel()

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 See Also: SeekableByteChannel

Returns
Type Description
ReadAsSeekableChannel