Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mcap0StreamReader

A streaming reader for MCAP files.

Usage example:

const reader = new Mcap0StreamReader();
stream.on("data", (data) => {
try {
reader.append(data);
for (let record; (record = reader.nextRecord()); ) {
// process available records
}
} catch (e) {
// handle errors
}
});

Hierarchy

  • Mcap0StreamReader

Implements

Index

Constructors

Properties

buffer: default = ...
channelsById: Map<number, Channel & { type: "Channel" }> = ...
decompressHandlers: DecompressHandlers
doneReading: boolean = false
generator: Generator<undefined | TypedMcapRecord, undefined | TypedMcapRecord, void> = ...
includeChunks: boolean
validateCrcs: boolean

Methods

  • append(data: Uint8Array): void
  • Provide the reader with newly received bytes for it to process. After calling this function, call nextRecord() again to parse any records that are now available.

    Parameters

    • data: Uint8Array

    Returns void

  • bytesRemaining(): number
  • done(): boolean
  • Read the next record from the stream if possible. If not enough data is available to parse a complete record, or if the reading has terminated with a valid footer, returns undefined.

    This function may throw any errors encountered during parsing. If an error is thrown, the reader is in an unspecified state and should no longer be used.

    Returns undefined | TypedMcapRecord

Generated using TypeDoc