Package com.google.cloud.storage
Interface ZeroCopySupport.DisposableByteString
- All Superinterfaces:
AutoCloseable,Closeable
- Enclosing class:
- ZeroCopySupport
@BetaApi
@InternalExtensionOnly
public static interface ZeroCopySupport.DisposableByteString
extends AutoCloseable, Closeable
Represents an object that can be accessed as a
ByteString, but has a lifecycle that
requires being explicitly closed in order to free up resources.
Instances of this class should be used in a try-with-resources to ensure they are released.
try (DisposableByteString disposableByteString = ...) {
System.out.println(disposableByteString.byteString().size());
}
- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.protobuf.ByteStringGet the ByteString representation of the underlying resourcesvoidclose()Signal the underlying resources that they can be released.
-
Method Details
-
byteString
com.google.protobuf.ByteString byteString()Get the ByteString representation of the underlying resources -
close
Signal the underlying resources that they can be released.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-