Interface ZeroCopySupport.DisposableByteString (2.52.2)

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());
 }
 

See Also: ReadProjectionConfigs#asFutureByteString()

Implements

AutoCloseable, Closeable

Methods

byteString()

public abstract ByteString byteString()

Get the ByteString representation of the underlying resources

Returns
Type Description
ByteString

close()

public abstract void close()

Signal the underlying resources that they can be released.

Exceptions
Type Description
IOException