1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Javascript ArrayBuffer 個人まとめ

Posted at

ArrayBuffer

一般的な固定長のバイナリーデータのバッファを示すために使用するデータ型です。ArrayBuffer の内容物を直接操作することはできません。

ArrayBuffer操作
// 操作できない
const buffer = new ArrayBuffer(10);
hoge[5] = 987;
// 表示のbufferに変化起きない
console.log(hoge);


// 操作できる
// Bufferを生成
const buffer = new ArrayBuffer(10);
// Bufferを操作できるような形式を生成
const hoge = new Uint8Array(buffer);
hoge[0] = 3;
hoge[2] = 254;
console.log(hoge);
// 表示のbufferに変化起きる
console.log(buffer);

Buffer

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?