Options
All
  • Public
  • Public/Protected
  • All
Menu

Class McapPre0Reader

A streaming reader for MCAP files.

Usage example:

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

Hierarchy

  • McapPre0Reader

Index

Constructors

  • new McapPre0Reader(__namedParameters?: McapReaderOptions): McapPre0Reader

Properties

buffer: default = ...
decompressHandlers: {}

Type declaration

  • [compression: string]: (buffer: Uint8Array, decompressedSize: bigint) => Uint8Array
      • (buffer: Uint8Array, decompressedSize: bigint): Uint8Array
      • Parameters

        • buffer: Uint8Array
        • decompressedSize: bigint

        Returns Uint8Array

doneReading: boolean = false
generator: Generator<undefined | McapPre0Types.McapRecord, undefined | McapPre0Types.McapRecord, void> = ...
includeChunks: boolean
validateChunkCrcs: 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
  • Returns number

    The number of bytes that have been received by append() but not yet parsed.

  • 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 | McapPre0Types.McapRecord

Generated using TypeDoc