GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: clarify memory sharing behavior of buffer ctor · nodejs/node@4fd765e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • buffer.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/buffer.md‎

Copy file name to clipboardExpand all lines: doc/api/buffer.md
+16-14Lines changed: 16 additions & 14 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -348,15 +348,16 @@ deprecated: v6.0.0
348348
> [`Buffer.from(arrayBuffer[, byteOffset [, length]])`][`Buffer.from(arrayBuffer)`]
349349
> instead.
350350
351-
* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a [`TypedArray`] or
352-
[`ArrayBuffer`]
353-
* `byteOffset` {Integer} Where to start copying from `arrayBuffer`. **Default:** `0`
354-
* `length` {Integer} How many bytes to copy from `arrayBuffer`.
351+
* `arrayBuffer` {ArrayBuffer} An [`ArrayBuffer`] or the `.buffer` property of a
352+
[`TypedArray`].
353+
* `byteOffset` {Integer} Index of first byte to expose. **Default:** `0`
354+
* `length` {Integer} Number of bytes to expose.
355355
**Default:** `arrayBuffer.length - byteOffset`
356356

357-
When passed a reference to the `.buffer` property of a [`TypedArray`] instance,
358-
the newly created `Buffer` will share the same allocated memory as the
359-
[`TypedArray`].
357+
This creates a view of the [`ArrayBuffer`] without copying the underlying
358+
memory. For example, when passed a reference to the `.buffer` property of a
359+
[`TypedArray`] instance, the newly created `Buffer` will share the same
360+
allocated memory as the [`TypedArray`].
360361

361362
The optional `byteOffset` and `length` arguments specify a memory range within
362363
the `arrayBuffer` that will be shared by the `Buffer`.
@@ -726,15 +727,16 @@ A `TypeError` will be thrown if `array` is not an `Array`.
726727
added: v5.10.0
727728
-->
728729

729-
* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a [`TypedArray`] or
730-
[`ArrayBuffer`]
731-
* `byteOffset` {Integer} Where to start copying from `arrayBuffer`. **Default:** `0`
732-
* `length` {Integer} How many bytes to copy from `arrayBuffer`.
730+
* `arrayBuffer` {ArrayBuffer} An [`ArrayBuffer`] or the `.buffer` property of a
731+
[`TypedArray`].
732+
* `byteOffset` {Integer} Index of first byte to expose. **Default:** `0`
733+
* `length` {Integer} Number of bytes to expose.
733734
**Default:** `arrayBuffer.length - byteOffset`
734735

735-
When passed a reference to the `.buffer` property of a [`TypedArray`] instance,
736-
the newly created `Buffer` will share the same allocated memory as the
737-
[`TypedArray`].
736+
This creates a view of the [`ArrayBuffer`] without copying the underlying
737+
memory. For example, when passed a reference to the `.buffer` property of a
738+
[`TypedArray`] instance, the newly created `Buffer` will share the same
739+
allocated memory as the [`TypedArray`].
738740

739741
Example:
740742

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.