Class: Head

Head

Parameters:
Name Type Description
chunk Chunk the chunk to point to
offset number the byte offset inside the chunk
Source:

Methods

read(n) → {Promise.<Buffer>}

Reads a maximum number of bytes.
Parameters:
Name Type Description
n number | string number of bytes, e.g. '4mb'
Source:
Returns:
- a buffer with length less or equal n
Type
Promise.<Buffer>

seek(n) → {Promise.<Head>}

Seeks forward a given number of bytes.
Parameters:
Name Type Description
n number | string number of bytes, e.g. '4mb'
Source:
Returns:
- a new head if enough bytes are left, null otherwise
Type
Promise.<Head>