Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Bytes

Read-only interface for values that are internally represented as binary data.

This interface provides access to copies of the binary data, making instances effectively immutable. Methods of derived interfaces and classes that relax this restriction and expose access to the internal data should be clearly documented.

since

5.7

Hierarchy

Index

Methods

asBuffer

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

    Returns Buffer

    This value in binary form

copyTo

  • copyTo(target: Buffer, offset?: undefined | number): void
  • Copy the binary data to a provided buffer.

    When running the Diffusion Client in a browser context, access to the Buffer api is made available through diffusion.buffer.

    Parameters

    • target: Buffer

      the buffer to copy data to

    • Optional offset: undefined | number

      the position in the target buffer at which data will be copied

    Returns void

length

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

    Returns number

    The length of the data in bytes