chunks

os.read.chunks
object chunks

Reads the contents of the given os.Path in chunks of the given size; returns a generator which provides a byte array and an offset into that array which contains the data for that chunk. All chunks will be of the given size, except for the last chunk which may be smaller.

Note that the array returned by the generator is shared between each callback; make sure you copy the bytes/array somewhere else if you want to keep them around.

Optionally takes in a provided input buffer instead of a chunkSize, allowing you to re-use the buffer between invocations.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
chunks.type

Members list

Value members

Concrete methods

def apply(p: ReadablePath, chunkSize: Int): Generator[(Array[Byte], Int)]
def apply(p: ReadablePath, buffer: Array[Byte]): Generator[(Array[Byte], Int)]