Class ReadProjectionConfigs

java.lang.Object
com.google.cloud.storage.ReadProjectionConfigs

@BetaApi public final class ReadProjectionConfigs extends Object
Factory class to select ReadProjectionConfigs.

There are multiple projections which can be used to access the content of a BlobInfo in Google Cloud Storage.

Since:
2.51.0 This new api is in preview and is subject to breaking changes.
See Also:
  • Method Details

    • asChannel

      @BetaApi 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

      Since:
      2.51.0 This new api is in preview and is subject to breaking changes.
      See Also:
    • asFutureBytes

      @BetaApi 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.

      Since:
      2.51.0 This new api is in preview and is subject to breaking changes.
      See Also:
      • ApiFuture
    • asFutureByteString

      @BetaApi public static ReadAsFutureByteString asFutureByteString()
      Read a range of bytes as an ApiFuture<ZeroCopySupport.DisposableByteString>

      The resulting ZeroCopySupport.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.

      Since:
      2.51.0 This new api is in preview and is subject to breaking changes.
      See Also:
      • ApiFuture
      • ByteString
    • asSeekableChannel

      @BetaApi 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

      Since:
      2.51.0 This new api is in preview and is subject to breaking changes.
      See Also: