Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RecordV2Impl

Implementation of RecordV2Delta

Hierarchy

Implements

Index

Constructors

constructor

  • new RecordV2Impl(buffer: Uint8Array, offset?: number, length?: number): RecordV2Impl
  • Create a RecordV2DeltaImpl instance

    Parameters

    • buffer: Uint8Array

      the internal buffer

    • Default value offset: number = 0

      the offset of the slice

    • Default value length: number = buffer.length

      the number of bytes in the slice

    Returns RecordV2Impl

Properties

$buffer

$buffer: Uint8Array

The internal buffer

$length

$length: number

The number of bytes in the slice

$offset

$offset: number

The offset of the slice

Methods

apply

  • Apply a delta and return a buffer with containing a modified record.

    If the delta does not contain any changes this is returned.

    throws

    an InvalidDataError if the delta is invalid

    Parameters

    Returns RecordV2

    the modified record

asArray

  • asArray(): Uint8Array
  • Get a copy of the array containing this value.

    Returns Uint8Array

    This value in binary form

asBuffer

  • asBuffer(): Buffer
  • Get a copy of the buffer containing this value.

    deprecated

    since version 6.11. Buffer has been replaced by Uint8Array. This will be removed in a future release.

    Returns Buffer

    This value in binary form

asFields

  • asFields(): string[]
  • Returns the data content as a list of fields.

    This disregards record boundaries. If there is more than one record, they are concatenated to produce a list of all of the fields.

    This method would normally only be used when it is known that there is only one record.

    Returns string[]

    a new mutable list of all the fields

asModel

  • inheritdoc

    Parameters

    Returns RecordModelImpl

asRecords

  • asRecords(): string[][]
  • Returns the data content as an Array of Arrays of strings.

    Example:

    // Iterate across each record's fields
    value.asRecords().forEach((record) => {
        record.forEach((field) => {
            console.log("Field value: " + field);
        });
    });
    

    Returns string[][]

    a new mutable list where each entry represents a record within the data

asValidatedModel

  • inheritdoc

    Parameters

    Returns RecordModelImpl

binaryDiff

  • Calculate the binary difference between the record and another buffer.

    Parameters

    Returns BinaryDeltaImpl

copyTo

  • copyTo(target: Uint8Array, offset?: number): void
  • inheritdoc

    Parameters

    • target: Uint8Array
    • Default value offset: number = 0

    Returns void

diff

  • Compare this value with an earlier version to calculate a structural delta.

    Parameters

    • original: RecordV2

      the original value to compare with this value

    Returns RecordV2Delta

    a structural delta representing the difference between the original and this value

equalBytes

  • equalBytes(buffer: Uint8Array, offset?: number, length?: number): boolean
  • Check if the Bytes are equal to a buffer slices

    Parameters

    • buffer: Uint8Array

      the buffer

    • Default value offset: number = 0

      the offset of the slice

    • Default value length: number = buffer.length

      the number of bytes in the slice

    Returns boolean

    true if the two bytes are equal

equals

  • Check if the Bytes are equal to a buffer slices

    Parameters

    Returns boolean

    true if the two bytes are equal

length

  • length(): number
  • Get the number of bytes

    Returns number

    The length of the data in bytes

toString

  • toString(): string
  • Convert the objet to a string

    Returns string

    a string representation of the RecordV2Impl

Static from

  • Create a new RecordV2 object from a buffer or RecordV2Impl. If a RecordV2Impl is passed as argument it is simply returned.

    Parameters

    • value: RecordV2Impl | Uint8Array

      the object to create a record from

    Returns RecordV2Impl

    the record created

Static toString

  • toString(): string
  • Return the name of the data type

    Returns string

    RecordV2Impl

Copyright © 2025 DiffusionData Ltd. All Rights Reserved.