Interface BlobAppendableUpload.AppendableUploadWriteableByteChannel
- All Superinterfaces:
AutoCloseable,Channel,Closeable,WritableByteChannel
- Enclosing interface:
- BlobAppendableUpload
WritableByteChannel returned from BlobAppendableUpload.open().
This interface allows writing bytes to an Appendable Upload, and provides methods to close this channel -- optionally finalizing the upload.
- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this instance to furtherWritableByteChannel.write(ByteBuffer)ing.voidClose this instance to furtherWritableByteChannel.write(ByteBuffer)ing without finalizing the upload.voidFinalize the upload and close this instance to furtherWritableByteChannel.write(ByteBuffer)ing.Methods inherited from interface java.nio.channels.WritableByteChannel
write
-
Method Details
-
finalizeAndClose
Finalize the upload and close this instance to furtherWritableByteChannel.write(ByteBuffer)ing. This will close any underlying stream and release any releasable resources once out of scope.Once this method is called, and returns no more writes to the object will be allowed by GCS.
This method and
close()are mutually exclusive. If one of the other methods are called before this method, this method will be a no-op.- Throws:
IOException- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
- See Also:
-
closeWithoutFinalizing
Close this instance to furtherWritableByteChannel.write(ByteBuffer)ing without finalizing the upload. This will close any underlying stream and release any releasable resources once out of scope.This method,
finalizeAndClose()andclose()are mutually exclusive. If one of the other methods are called before this method, this method will be a no-op.- Throws:
IOException- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
- See Also:
-
close
Close this instance to furtherWritableByteChannel.write(ByteBuffer)ing.Whether the upload is finalized during this depends on the
BlobAppendableUploadConfig.getCloseAction()provided to create theBlobAppendableUpload. IfBlobAppendableUploadConfig.getCloseAction()==BlobAppendableUploadConfig.CloseAction.FINALIZE_WHEN_CLOSING,finalizeAndClose()will be called. IfBlobAppendableUploadConfig.getCloseAction()==BlobAppendableUploadConfig.CloseAction.CLOSE_WITHOUT_FINALIZING,closeWithoutFinalizing()will be called.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
- See Also:
-