Send feedback
Class BaseWriteChannel<ServiceOptionsT,EntityT> (2.8.4)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.8.4 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 )
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.
Returns
close()
public final void close ()
Exceptions
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
getChunkSize()
protected int getChunkSize ()
Returns
getDefaultChunkSize()
protected int getDefaultChunkSize ()
Returns
getEntity()
protected EntityT getEntity ()
Returns
getLimit()
Returns
getMinChunkSize()
protected int getMinChunkSize ()
Returns
getOptions()
protected ServiceOptionsT getOptions ()
Returns
Type Description ServiceOptionsT
getPosition()
protected long getPosition ()
Returns
getUploadId()
protected String getUploadId ()
Returns
isOpen()
Returns
restore(BaseWriteChannel.BaseState state)
protected void restore ( BaseWriteChannel . BaseState state )
Restores the state of the current write channel given a BaseState object.
Parameter
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 )
Parameter
Returns
Exceptions
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-10-03 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-10-03 UTC."}
[[["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-10-03 UTC."]]