Send feedback
Class BaseWriteChannel<ServiceOptionsT,EntityT> (2.41.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.41.0 keyboard_arrow_down
public abstract class BaseWriteChannel<ServiceOptionsT , EntityT > implements WriteChannel
Type Parameters
Name
Description
ServiceOptionsT
EntityT
Constructors
BaseWriteChannel(ServiceOptionsT options, EntityT entity, String uploadId)
protected BaseWriteChannel ( ServiceOptionsT options , EntityT entity , String uploadId )
Internal Only : This feature is not stable for application use.
This class should only be extended within google-cloud-java
Parameters
Name
Description
options
ServiceOptionsT
entity
EntityT
uploadId
String
Methods
capture()
public RestorableState<WriteChannel> capture ()
Captures the write channel state so that it can be saved and restored afterwards. The original
WriteChannel
and the restored one should not both be used. Closing one channel causes
the other channel to close; subsequent writes will fail.
close()
public final void close ()
flushBuffer(int length, boolean last)
protected abstract void flushBuffer ( int length , boolean last )
Parameters
Name
Description
length
int
the number of bytes to write from #getBuffer()
last
boolean
if true
the resumable session is closed
getBuffer()
protected byte [] getBuffer ()
Returns
Type
Description
byte []
getChunkSize()
protected int getChunkSize ()
Returns
Type
Description
int
getDefaultChunkSize()
protected int getDefaultChunkSize ()
Returns
Type
Description
int
getEntity()
protected EntityT getEntity ()
Returns
Type
Description
EntityT
getLimit()
Returns
Type
Description
int
getMinChunkSize()
protected int getMinChunkSize ()
Returns
Type
Description
int
getOptions()
protected ServiceOptionsT getOptions ()
Returns
Type
Description
ServiceOptionsT
getPosition()
protected long getPosition ()
Returns
Type
Description
long
getUploadId()
protected String getUploadId ()
Returns
Type
Description
String
isOpen()
restore(BaseWriteChannel.BaseState state)
protected void restore ( BaseWriteChannel . BaseState state )
Restores the state of the current write channel given a BaseState object.
setChunkSize(int chunkSize)
public final 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.
Parameter
Name
Description
chunkSize
int
stateBuilder()
protected abstract BaseWriteChannel . BaseState . Builder<ServiceOptionsT , EntityT > stateBuilder ()
Creates a BaseState.Builder for the current write channel.
Returns
Type
Description
Builder <ServiceOptionsT ,EntityT >
write(ByteBuffer byteBuffer)
public final int write ( ByteBuffer byteBuffer )
Returns
Type
Description
int
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-06 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-06 UTC."],[],[]]