buf.buffer


  • <ArrayBuffer> 创建此 Buffer 对象所基于的底层 ArrayBuffer 对象。

不保证此 ArrayBuffer 与原始 Buffer 完全对应。 有关详细信息,请参阅 buf.byteOffset 上的说明。

const arrayBuffer = new ArrayBuffer(16);
const buffer = Buffer.from(arrayBuffer);

console.log(buffer.buffer === arrayBuffer);
// 打印: true
  • <ArrayBuffer> The underlying ArrayBuffer object based on which this Buffer object is created.

This ArrayBuffer is not guaranteed to correspond exactly to the original Buffer. See the notes on buf.byteOffset for details.

const arrayBuffer = new ArrayBuffer(16);
const buffer = Buffer.from(arrayBuffer);

console.log(buffer.buffer === arrayBuffer);
// Prints: true