YouTube.js
Guide
Discord
❤️ Sponsor
GitHub
Guide
Discord
❤️ Sponsor
GitHub

googlevideo / exports/ump / UmpReader

Class: UmpReader

Defined in: codeberg/googlevideo/src/core/UmpReader.ts:7

A parser that efficiently processes chunked UMP binary data.

Constructors

Constructor

new UmpReader(compositeBuffer): UmpReader

Defined in: codeberg/googlevideo/src/core/UmpReader.ts:8

Parameters

compositeBuffer

CompositeBuffer

Returns

UmpReader

Methods

canReadFromCurrentChunk()

canReadFromCurrentChunk(offset, length): boolean

Defined in: codeberg/googlevideo/src/core/UmpReader.ts:126

Checks if the specified bytes can be read from the current chunk.

Parameters

offset

number

Position to start reading from.

length

number

Number of bytes to read.

Returns

boolean

True if bytes can be read from current chunk, false otherwise.


getCurrentDataView()

getCurrentDataView(): DataView

Defined in: codeberg/googlevideo/src/core/UmpReader.ts:134

Gets a DataView of the current chunk, creating it if necessary.

Returns

DataView

DataView for the current chunk.


read()

read(handlePart): undefined | Part

Defined in: codeberg/googlevideo/src/core/UmpReader.ts:15

Parses parts from the buffer and calls the handler for each complete part.

Parameters

handlePart

(part) => void

Function called with each complete part.

Returns

undefined | Part

Partial part if parsing is incomplete, undefined otherwise.


readVarInt()

readVarInt(offset): [number, number]

Defined in: codeberg/googlevideo/src/core/UmpReader.ts:57

Reads a variable-length integer from the buffer.

Parameters

offset

number

Position to start reading from.

Returns

[number, number]

Tuple of [value, new offset] or [-1, offset] if incomplete.

Edit this page
Last Updated: 7/24/25, 1:11 PM