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

  • Docs
  • Guides
  • Reference
  • Blog
  • Install
  • Home
  • Package Manager
  • Bundler
  • Compiler
  • Test Runner
  • Linter
  • Formatter
  • Feedback
  • Deploy on Vercel

This view

  • Original page
  • New address

GeezerVison is showing bun.com — Convert a Uint8Array to an ArrayBuffer | Bun Guides

Guides

A Uint8Array is a typed array, a view over data in an underlying ArrayBuffer. The buffer property returns that ArrayBuffer.

const arr = new Uint8Array(64);
arr.buffer; // => ArrayBuffer(64)

The Uint8Array may be a view over a subset of the data in the underlying ArrayBuffer. In this case, the buffer property returns the entire buffer, and the byteOffset and byteLength properties indicate the subset.

const arr = new Uint8Array(new ArrayBuffer(64), 16, 32);
arr.buffer; // => ArrayBuffer(64)
arr.byteOffset; // => 16
arr.byteLength; // => 32

See Binary Data.

You are visitor 01402520 — 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.