# ArrayBuffer

固定长度的原始二进制缓冲区。

¥A fixed-length raw binary buffer.

ArrayBuffer API 与 JavaScript (MDN (opens new window)) 中的完全相同。

¥The ArrayBuffer API is exactly as in JavaScript (MDN (opens new window)).

# 构造函数

¥Constructor

  • new ArrayBuffer(length: i32)
    

    构造给定长度(以字节为单位)的新缓冲区。

    ¥Constructs a new buffer of the given length in bytes.

# 静态成员

¥Static members

  • function isView<T>(value: T): bool
    

    如果 value 是缓冲区视图之一(例如 类型数组DataView 之一),则返回 true。

    ¥Returns true if value is one of the buffer views, such as one of the typed arrays or a DataView.

# 实例成员

¥Instance members

# 字段

¥Fields

  • readonly byteLength: i32
    

    缓冲区的长度,以字节为单位。

    ¥The buffer's length, in bytes.

# 方法

¥Methods

  • function slice(begin?: i32, end?: i32): ArrayBuffer
    

    返回此缓冲区的副本,从开始(包含)到结束(不包含)。

    ¥Returns a copy of this buffer from begin, inclusive, up to end, exclusive.

  • function toString(): string
    

    返回此缓冲区的字符串表示形式。

    ¥Returns a string representation of this buffer.