Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DataBuffer

Hierarchy

  • DataBuffer

Index

Methods

Methods

Static append

  • append(target: Buffer, data: Buffer, offset?: number, len?: number): Buffer
  • Returns a new buffer holding the data initially in the target buffer with the new data from the source buffer appended.

    Parameters

    • target: Buffer

      The target buffer where to append data into.

    • data: Buffer

      The source buffer to append data from.

    • Default value offset: number = 0
    • Optional len: number

    Returns Buffer

Static copy

  • copy(data: Buffer, offset?: number, len?: number): Buffer
  • Copy the data from a source buffer and returns a new data buffer, unless the offset is zero and the complete message is to be copied in which case the source buffer is returned.

    Parameters

    • data: Buffer

      The source data buffer.

    • Default value offset: number = 0

      The starting offset to start copying from.

    • Optional len: number

      The lenght of data to be copied.

    Returns Buffer