Interface BlobAppendableUpload.AppendableUploadWriteableByteChannel (2.52.2)

public static interface BlobAppendableUpload.AppendableUploadWriteableByteChannel extends WritableByteChannel

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

Implements

WritableByteChannel

Methods

close()

public abstract void close()

Close this instance to further #write(ByteBuffer)ing.

Whether the upload is finalized during this depends on the BlobAppendableUploadConfig#getCloseAction() provided to create the BlobAppendableUpload. If BlobAppendableUploadConfig#getCloseAction()== CloseAction#FINALIZE_WHEN_CLOSING, #finalizeAndClose() will be called. If BlobAppendableUploadConfig#getCloseAction()== CloseAction#CLOSE_WITHOUT_FINALIZING, #closeWithoutFinalizing() will be called. See Also: Storage#blobAppendableUpload(BlobInfo, BlobAppendableUploadConfig, BlobWriteOption...), BlobAppendableUploadConfig#getCloseAction(), BlobAppendableUploadConfig#withCloseAction(CloseAction)

Exceptions
Type Description
IOException

closeWithoutFinalizing()

public abstract void closeWithoutFinalizing()

Close this instance to further #write(ByteBuffer)ing without finalizing the upload. This will close any underlying stream and release any releasable resources once out of scope.

This method, AppendableUploadWriteableByteChannel#finalizeAndClose() and AppendableUploadWriteableByteChannel#close() are mutually exclusive. If one of the other methods are called before this method, this method will be a no-op. See Also: BlobAppendableUploadConfig.CloseAction#CLOSE_WITHOUT_FINALIZING, Storage#blobAppendableUpload(BlobInfo, BlobAppendableUploadConfig, BlobWriteOption...), BlobAppendableUploadConfig#getCloseAction(), BlobAppendableUploadConfig#withCloseAction(CloseAction)

Exceptions
Type Description
IOException

finalizeAndClose()

public abstract void finalizeAndClose()

Finalize the upload and close this instance to further #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. See Also: BlobAppendableUploadConfig.CloseAction#FINALIZE_WHEN_CLOSING, Storage#blobAppendableUpload(BlobInfo, BlobAppendableUploadConfig, BlobWriteOption...), BlobAppendableUploadConfig#getCloseAction(), BlobAppendableUploadConfig#withCloseAction(CloseAction)

Exceptions
Type Description
IOException