File$stream
File$stream(callback, start_byte=0) → void
Read the file in a streaming manner. As the file is consumed, the callback
function will repeatedly be called with the next chunk of bytes.
Parameters:
callback
: function(chunk)
A function that will be called as the file contents are streamed. chunk
is a raw vector containing the latest bytes received from the server, and will usually be 16k or less.
start_byte
: int, default 0
The offset byte at which to start reading the file. Allows for reading part of a file. If not specified, the file will be read from the start.
Returns:
void
Examples
f = redivis$file("rnwk-acs3famee.pVr4Gzq54L3S9pblMZTs5Q")
# Stream a file
data <- f$stream(function(x) {
print(length(x))
})
Last updated
Was this helpful?