Skip to content
Permalink
Browse files

doc: note that buf.buffer's contents might differ

This bit me in a personal project since I had no reason to read the
`buf.byteOffset` docs, so point readers there explicitly.

PR-URL: #29651
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
strugee authored and MylesBorins committed Sep 22, 2019
1 parent da1e5ae commit 5334f59519f710cffde227c90ce63b48c24a4147
Showing with 3 additions and 0 deletions.
  1. +3 −0 doc/api/buffer.md
@@ -1025,6 +1025,9 @@ console.log(buf.toString('ascii'));
* {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.

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

0 comments on commit 5334f59

Please sign in to comment.
You can’t perform that action at this time.