Buffer object used with I/O API.

Remarks

The indices parameters are all zero based with TypeScript API.

Hierarchy

  • lbuffer

Indexable

[index: number]: number

Constructors

  • Create an lbuffer object.

    Parameters

    • Optional capOrValue: string | number | lbuffer

      Capacity, or a value to copy.

      Optional

    Returns lbuffer

Properties

length: number

Get the length.

See

setlen

Methods

  • Parameters

    • Rest ...args: number[]
      Rest

    Returns lbuffer

    self.

  • Get byte value by index.

    Parameters

    • index: number

      Zero based index.

    Returns number

  • Clears part of the buffer.

    Parameters

    • Optional pos: number
      Optional
    • Optional end: number
      Optional

    Returns lbuffer

  • Compares against another value.

    Parameters

    • s: string | lbuffer

      The value to compare.

    Returns number

    A number indicating this value and another compare to each other:

    • A negative value if this value comes before another;
    • A positive value if this value after another;
    • 0 if they are considered equal.
  • Copy part of the buffer into a new buffer.

    Parameters

    • Optional pos: number

      Start position, inclusive.

      Optional
    • Optional end: number

      End poisiton, exclusive.

      Optional

    Returns lbuffer

    A new lbuffer.

    Remarks

    Length is end - pos;

  • Insert into the current lbuffer.

    Parameters

    • index: number

      Position to insert from.

    • value: string | lbuffer

      Value to insert.

    • Optional pos: number

      Start position of the value, inclusive.

      Optional
    • Optional end: number

      End position of the value, exclusive.

      Optional

    Returns lbuffer

    Self

  • Move part of buffer to a new position.

    Parameters

    • dst: number

      Destination position.

    • pos: number

      Start position, inclusive.

    • Optional end: number

      end position, exclusive.

      Optional

    Returns lbuffer

  • Removes part of the buffer.

    Parameters

    • Optional pos: number

      Start position, inclusive.

      Optional
    • Optional end: number

      End poisiton, exclusive.

      Optional

    Returns lbuffer

    Remarks

    Length is end - pos;

  • Set the value of the buffer.

    Parameters

    • index: number

      Starting index.

    • value: string | lbuffer

      The source.

    • Optional pos: number

      Start position, inclusive.

      Optional
    • Optional end: number

      End poisiton, exclusive.

      Optional

    Returns lbuffer

    Self.

    Remarks

    Length is end - pos;

  • Set the length of the buffer.

    Parameters

    • v: number

    Returns lbuffer

    self.

  • Swap between two slices.

    Parameters

    • p1: number

      Position of part 1, inclusive.

    • e1: number

      End of part 1, exclusive.

    • p2: number

      Position of part 2, inclusive.

    • Optional e2: number

      End of part 2, exclusive.

      Optional

    Returns lbuffer

  • Convert part of the buffer into a lua string.

    Parameters

    • Optional pos: number

      Position

      Optional
    • Optional len: number

      Length

      Optional

    Returns string

    The resulting string.

Generated using TypeDoc