bun-convert-an-arraybuffer-to-a-uint8array
Convert an ArrayBuffer to a Uint8Array
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Convert an ArrayBuffer to a Uint8Array
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Configure a private registry for an organization scope with bun install
Speed up JavaScript execution with bytecode caching in Bun's bundler
Bun's bundler has built-in support for CSS with modern features
Migration guide from esbuild to Bun's bundler
Generate standalone executables from TypeScript or JavaScript files with Bun
Build fullstack applications with Bun's integrated dev server that bundles frontend assets and handles API routes
| name | Bun Convert an ArrayBuffer to a Uint8Array |
| description | Convert an ArrayBuffer to a Uint8Array |
A Uint8Array is a typed array, meaning it is a mechanism for viewing the data in an underlying ArrayBuffer.
const buffer = new ArrayBuffer(64);
const arr = new Uint8Array(buffer);
Instances of other typed arrays can be created similarly.
const buffer = new ArrayBuffer(64);
const arr1 = new Uint8Array(buffer);
const arr2 = new Uint16Array(buffer);
const arr3 = new Uint32Array(buffer);
const arr4 = new Float32Array(buffer);
const arr5 = new Float64Array(buffer);
const arr6 = new BigInt64Array(buffer);
const arr7 = new BigUint64Array(buffer);
To create a typed array that only views a portion of the underlying buffer, pass the offset and length to the constructor.
const buffer = new ArrayBuffer(64);
const arr = new Uint8Array(buffer, 0, 16); // view first 16 bytes
See Docs > API > Utils for more useful utilities.