Package com.google.cloud
Interface WriteChannel
-
- All Superinterfaces:
AutoCloseable
,Channel
,Closeable
,Restorable<WriteChannel>
,WritableByteChannel
- All Known Implementing Classes:
BaseWriteChannel
public interface WriteChannel extends WritableByteChannel, Closeable, Restorable<WriteChannel>
A channel for writing data to Google Cloud services.Implementations of this class may further buffer data internally to reduce remote calls. Written data might not be visible until calling
Channel.close()
. This interface implementsRestorable
to allow saving the writer's state to continue writing afterwards.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RestorableState<WriteChannel>
capture()
Captures the write channel state so that it can be saved and restored afterwards.void
setChunkSize(int chunkSize)
Sets the minimum size that will be written by a single RPC.-
Methods inherited from interface java.nio.channels.WritableByteChannel
write
-
-
-
-
Method Detail
-
setChunkSize
void setChunkSize(int chunkSize)
Sets the minimum size that will be written by a single RPC. Written data will be buffered and only flushed upon reaching this size or closing the channel.
-
capture
RestorableState<WriteChannel> capture()
Captures the write channel state so that it can be saved and restored afterwards. The originalWriteChannel
and the restored one should not both be used. Closing one channel causes the other channel to close; subsequent writes will fail.- Specified by:
capture
in interfaceRestorable<WriteChannel>
- Returns:
- a
RestorableState
object that contains the write channel state and can restore it afterwards.
-
-