神岛 API 文档 - ArenaPro版
    Preparing search index...

    Interface DataView<TArrayBuffer>

    提供对 ArrayBuffer 的低级接口,用于读取和写入多种数字类型。

    Provides a low-level interface for reading and writing multiple number types in an ArrayBuffer.

    interface DataView<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
        "[toStringTag]": string;
        buffer: TArrayBuffer;
        byteLength: number;
        byteOffset: number;
        getBigInt64(byteOffset: number, littleEndian?: boolean): bigint;
        getBigInt64(byteOffset: number, littleEndian?: boolean): bigint;
        getBigUint64(byteOffset: number, littleEndian?: boolean): bigint;
        getBigUint64(byteOffset: number, littleEndian?: boolean): bigint;
        getFloat32(byteOffset: number, littleEndian?: boolean): number;
        getFloat32(byteOffset: number, littleEndian?: boolean): number;
        getFloat64(byteOffset: number, littleEndian?: boolean): number;
        getFloat64(byteOffset: number, littleEndian?: boolean): number;
        getInt16(byteOffset: number, littleEndian?: boolean): number;
        getInt16(byteOffset: number, littleEndian?: boolean): number;
        getInt32(byteOffset: number, littleEndian?: boolean): number;
        getInt32(byteOffset: number, littleEndian?: boolean): number;
        getInt8(byteOffset: number): number;
        getInt8(byteOffset: number): number;
        getUint16(byteOffset: number, littleEndian?: boolean): number;
        getUint16(byteOffset: number, littleEndian?: boolean): number;
        getUint32(byteOffset: number, littleEndian?: boolean): number;
        getUint32(byteOffset: number, littleEndian?: boolean): number;
        getUint8(byteOffset: number): number;
        getUint8(byteOffset: number): number;
        setBigInt64(
            byteOffset: number,
            value: bigint,
            littleEndian?: boolean,
        ): void;
        setBigInt64(
            byteOffset: number,
            value: bigint,
            littleEndian?: boolean,
        ): void;
        setBigUint64(
            byteOffset: number,
            value: bigint,
            littleEndian?: boolean,
        ): void;
        setBigUint64(
            byteOffset: number,
            value: bigint,
            littleEndian?: boolean,
        ): void;
        setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
        setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
        setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
        setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
        setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
        setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
        setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
        setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
        setInt8(byteOffset: number, value: number): void;
        setInt8(byteOffset: number, value: number): void;
        setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
        setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
        setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
        setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
        setUint8(byteOffset: number, value: number): void;
        setUint8(byteOffset: number, value: number): void;
    }

    Type Parameters

    • TArrayBuffer extends ArrayBufferLike = ArrayBufferLike
    Index

    Properties

    "[toStringTag]": string

    一个字符串值,用于创建对象的默认字符串描述。由内置方法 Object.prototype.toString 调用。

    A String value that is used in the creation of the default string description of an object. Called by the built-in method Object.prototype.toString.

    buffer: TArrayBuffer

    此视图引用的 ArrayBuffer。

    The ArrayBuffer referenced by this view.

    byteLength: number

    此视图的字节长度。

    The byte length of this view.

    byteOffset: number

    此视图在其 ArrayBuffer 中的字节偏移量。

    The byte offset of this view from the start of its ArrayBuffer.

    Methods

    • Gets the BigInt64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns bigint

    • Parameters

      • byteOffset: number
      • OptionallittleEndian: boolean

      Returns bigint

      从视图的指定字节偏移量处获取一个 BigInt64 值。没有对齐约束;多字节值可以从任何偏移量获取。

      Gets the BigInt64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      应从中检索值的缓冲区中的位置。

      The place in the buffer at which the value should be retrieved.

      指示64位整数是小端还是大端格式。如果为false或未定义,则应写入一个大端值。

      If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written.

    • Gets the BigUint64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns bigint

    • Parameters

      • byteOffset: number
      • OptionallittleEndian: boolean

      Returns bigint

      从视图的指定字节偏移量处获取一个 BigUint64 值。没有对齐约束;多字节值可以从任何偏移量获取。

      Gets the BigUint64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      应从中检索值的缓冲区中的位置。

      The place in the buffer at which the value should be retrieved.

      指示64位无符号整数是小端还是大端格式。如果为false或未定义,则应写入一个大端值。

      If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written.

    • Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns number

    • Parameters

      • byteOffset: number
      • OptionallittleEndian: boolean

      Returns number

      从视图开始的指定字节偏移量处获取 Float32 值。没有对齐约束;可以从任何偏移量获取多字节值。

      Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      应检索值的缓冲区中的位置。

      The place in the buffer at which the value should be retrieved.

      是否使用小端字节序。

      Whether to use little-endian byte order.

    • Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns number

    • Parameters

      • byteOffset: number
      • OptionallittleEndian: boolean

      Returns number

      从视图开始的指定字节偏移量处获取 Float64 值。没有对齐约束;可以从任何偏移量获取多字节值。

      Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      应检索值的缓冲区中的位置。

      The place in the buffer at which the value should be retrieved.

      是否使用小端字节序。

      Whether to use little-endian byte order.

    • Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns number

    • Parameters

      • byteOffset: number
      • OptionallittleEndian: boolean

      Returns number

      从视图开始的指定字节偏移量处获取 Int16 值。没有对齐约束;可以从任何偏移量获取多字节值。

      Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      应检索值的缓冲区中的位置。

      The place in the buffer at which the value should be retrieved.

      是否使用小端字节序。

      Whether to use little-endian byte order.

    • Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns number

    • Parameters

      • byteOffset: number
      • OptionallittleEndian: boolean

      Returns number

      从视图开始的指定字节偏移量处获取 Int32 值。没有对齐约束;可以从任何偏移量获取多字节值。

      Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      应检索值的缓冲区中的位置。

      The place in the buffer at which the value should be retrieved.

      是否使用小端字节序。

      Whether to use little-endian byte order.

    • Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      Returns number

    • Parameters

      • byteOffset: number

      Returns number

      从视图开始的指定字节偏移量处获取 Int8 值。没有对齐约束;可以从任何偏移量获取多字节值。

      Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      应检索值的缓冲区中的位置。

      The place in the buffer at which the value should be retrieved.

    • Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns number

    • Parameters

      • byteOffset: number
      • OptionallittleEndian: boolean

      Returns number

      从视图开始的指定字节偏移量处获取 Uint16 值。没有对齐约束;可以从任何偏移量获取多字节值。

      Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      应检索值的缓冲区中的位置。

      The place in the buffer at which the value should be retrieved.

      是否使用小端字节序。

      Whether to use little-endian byte order.

    • Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be read.

      Returns number

    • Parameters

      • byteOffset: number
      • OptionallittleEndian: boolean

      Returns number

      从视图开始的指定字节偏移量处获取 Uint32 值。没有对齐约束;可以从任何偏移量获取多字节值。

      Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      应检索值的缓冲区中的位置。

      The place in the buffer at which the value should be retrieved.

      是否使用小端字节序。

      Whether to use little-endian byte order.

    • Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be retrieved.

      Returns number

    • Parameters

      • byteOffset: number

      Returns number

      从视图开始的指定字节偏移量处获取 Uint8 值。没有对齐约束;可以从任何偏移量获取多字节值。

      Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset.

      应检索值的缓冲区中的位置。

      The place in the buffer at which the value should be retrieved.

    • Stores a BigInt64 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: bigint

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Parameters

      • byteOffset: number
      • value: bigint
      • OptionallittleEndian: boolean

      Returns void

      在视图的指定字节偏移量处存储一个 BigInt64 值。

      Stores a BigInt64 value at the specified byte offset from the start of the view.

      应设置值的缓冲区中的位置。

      The place in the buffer at which the value should be set.

      要设置的值。

      The value to set.

      指示64位整数是小端还是大端格式。如果为false或未定义,则应写入一个大端值。

      If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written.

    • Stores a BigUint64 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: bigint

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Parameters

      • byteOffset: number
      • value: bigint
      • OptionallittleEndian: boolean

      Returns void

      在视图的指定字节偏移量处存储一个 BigUint64 值。

      Stores a BigUint64 value at the specified byte offset from the start of the view.

      应设置值的缓冲区中的位置。

      The place in the buffer at which the value should be set.

      要设置的值。

      The value to set.

      指示64位无符号整数是小端还是大端格式。如果为false或未定义,则应写入一个大端值。

      If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written.

    • Stores an Float32 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Parameters

      • byteOffset: number
      • value: number
      • OptionallittleEndian: boolean

      Returns void

      在视图开始的指定字节偏移量处存储 Float32 值。

      Stores an Float32 value at the specified byte offset from the start of the view.

      应设置值的缓冲区中的位置。

      The place in the buffer at which the value should be set.

      要设置的值。

      The value to set.

      如果为 false 或 undefined,则应写入大端值,否则应写入小端值。

      If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written.

    • Stores an Float64 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Parameters

      • byteOffset: number
      • value: number
      • OptionallittleEndian: boolean

      Returns void

      在视图开始的指定字节偏移量处存储 Float64 值。

      Stores an Float64 value at the specified byte offset from the start of the view.

      应设置值的缓冲区中的位置。

      The place in the buffer at which the value should be set.

      要设置的值。

      The value to set.

      如果为 false 或 undefined,则应写入大端值,否则应写入小端值。

      If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written.

    • Stores an Int16 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Parameters

      • byteOffset: number
      • value: number
      • OptionallittleEndian: boolean

      Returns void

      在视图开始的指定字节偏移量处存储 Int16 值。

      Stores an Int16 value at the specified byte offset from the start of the view.

      应设置值的缓冲区中的位置。

      The place in the buffer at which the value should be set.

      要设置的值。

      The value to set.

      如果为 false 或 undefined,则应写入大端值,否则应写入小端值。

      If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written.

    • Stores an Int32 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Parameters

      • byteOffset: number
      • value: number
      • OptionallittleEndian: boolean

      Returns void

      在视图开始的指定字节偏移量处存储 Int32 值。

      Stores an Int32 value at the specified byte offset from the start of the view.

      应设置值的缓冲区中的位置。

      The place in the buffer at which the value should be set.

      要设置的值。

      The value to set.

      如果为 false 或 undefined,则应写入大端值,否则应写入小端值。

      If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written.

    • Stores an Int8 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      Returns void

    • Parameters

      • byteOffset: number
      • value: number

      Returns void

      在视图开始的指定字节偏移量处存储 Int8 值。

      Stores an Int8 value at the specified byte offset from the start of the view.

      应设置值的缓冲区中的位置。

      The place in the buffer at which the value should be set.

      要设置的值。

      The value to set.

    • Stores an Uint16 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Parameters

      • byteOffset: number
      • value: number
      • OptionallittleEndian: boolean

      Returns void

      在视图开始的指定字节偏移量处存储 Uint16 值。

      Stores an Uint16 value at the specified byte offset from the start of the view.

      应设置值的缓冲区中的位置。

      The place in the buffer at which the value should be set.

      要设置的值。

      The value to set.

      如果为 false 或 undefined,则应写入大端值,否则应写入小端值。

      If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written.

    • Stores an Uint32 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      • OptionallittleEndian: boolean

        If false or undefined, a big-endian value should be written.

      Returns void

    • Parameters

      • byteOffset: number
      • value: number
      • OptionallittleEndian: boolean

      Returns void

      在视图开始的指定字节偏移量处存储 Uint32 值。

      Stores an Uint32 value at the specified byte offset from the start of the view.

      应设置值的缓冲区中的位置。

      The place in the buffer at which the value should be set.

      要设置的值。

      The value to set.

      如果为 false 或 undefined,则应写入大端值,否则应写入小端值。

      If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written.

    • Stores an Uint8 value at the specified byte offset from the start of the view.

      Parameters

      • byteOffset: number

        The place in the buffer at which the value should be set.

      • value: number

        The value to set.

      Returns void

    • Parameters

      • byteOffset: number
      • value: number

      Returns void

      在视图开始的指定字节偏移量处存储 Uint8 值。

      Stores an Uint8 value at the specified byte offset from the start of the view.

      应设置值的缓冲区中的位置。

      The place in the buffer at which the value should be set.

      要设置的值。

      The value to set.