@chickenjdk/byteutils
    Preparing search index...

    Class readableBuffer

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    read:
        | ((...args: [bytes: number]) => number[])
        | ((...args: [bytes: number]) => Uint8Array) = ...

    Read a array OR Uint8Array from the start of the buffer

    How many bytes to read

    readArrayBackwardsEndian:
        | ((...args: [bytes: number]) => number[])
        | ((...args: [bytes: number]) => number[]) = ...

    Read a number array (0-255) from the start of the buffer backwards (endian-dependent)

    How many bytes to read

    readArrayEndian:
        | ((...args: [bytes: number]) => number[])
        | ((...args: [bytes: number]) => number[]) = ...

    Read a number array (0-255) from the start of the buffer (endian-dependent)

    How many bytes to read

    readBackwards:
        | ((...args: [bytes: number]) => number[])
        | ((...args: [bytes: number]) => Uint8Array) = ...

    Read a array OR Uint8Array from the start of the buffer backwards

    How many bytes to read

    readBackwardsEndian:
        | cloneFunc<
            | ((...args: [bytes: number]) => number[])
            | ((...args: [bytes: number]) => Uint8Array),
        >
        | cloneFunc<
            | ((...args: [bytes: number]) => number[])
            | ((...args: [bytes: number]) => Uint8Array),
        > = ...

    Read a array-like (May be a array or uint8array but don't count on it) from the start of the buffer backwards (endian-dependent)

    readEndian:
        | cloneFunc<
            | ((...args: [bytes: number]) => number[])
            | ((...args: [bytes: number]) => Uint8Array),
        >
        | cloneFunc<
            | ((...args: [bytes: number]) => number[])
            | ((...args: [bytes: number]) => Uint8Array),
        > = ...

    Read a array-like (May be a array or uint8array but don't count on it) from the start of the buffer (endian-dependent)

    The data to write

    readUint8ArrayBackwardsEndian:
        | ((...args: [bytes: number]) => Uint8Array)
        | ((...args: [bytes: number]) => Uint8Array) = ...

    Read a Uint8Array from the start of the buffer backwards (endian-dependent)

    readUint8ArrayEndian:
        | ((...args: [bytes: number]) => Uint8Array)
        | ((...args: [bytes: number]) => Uint8Array) = ...

    Read a Uint8Array from the start of the buffer (endian-dependent)

    Accessors

    • get _offset(): number

      The current offset in the buffer

      Returns number

      The current offset in the buffer

    • get buffer(): Uint8Array

      Returns Uint8Array

    • set buffer(
          newValue:
              | Uint8Array<ArrayBufferLike>
              | readableBuffer
              | Buffer<ArrayBufferLike>,
      ): void

      Parameters

      • newValue: Uint8Array<ArrayBufferLike> | readableBuffer | Buffer<ArrayBufferLike>

      Returns void

    • get isLe(): boolean

      If the buffer is little endian

      Returns boolean

    • set isLe(isLe: boolean): void

      If the buffer is little endian

      Parameters

      • isLe: boolean

      Returns void

    • get length(): number

      The remaining length of the buffer

      Returns number

      The length of the buffer

    Methods

    • Parse a string

      Parameters

      • bytes: number

        How many bytes long the string is

      • Optionalmutf8: boolean = false

        If the string is mutf8

      Returns string

      The parsed string