Interface ReadChannel (2.3.5)

public interface ReadChannel extends ReadableByteChannel, Closeable, Restorable<ReadChannel>

A channel for reading data from a Google Cloud object.

Implementations of this class may buffer data internally to reduce remote calls. This interface implements Restorable to allow saving the reader's state to continue reading afterwards.

Implements

ReadableByteChannel, Closeable, com.google.cloud.Restorable<com.google.cloud.ReadChannel>

Methods

capture()

public abstract RestorableState<ReadChannel> capture()

Captures the read channel state so that it can be saved and restored afterwards.

Returns
TypeDescription
RestorableState<ReadChannel>

a RestorableState object that contains the read channel state and can restore it afterwards.

close()

public abstract void close()

Overridden to remove IOException.

seek(long position)

public abstract void seek(long position)
Parameter
NameDescription
positionlong
Exceptions
TypeDescription
IOException

setChunkSize(int chunkSize)

public abstract void setChunkSize(int chunkSize)

Sets the minimum size that will be read by a single RPC. Read data will be locally buffered until consumed.

Parameter
NameDescription
chunkSizeint