@teamteanpm2024/fugiat-asperiores-placeat

1.1.4 • Public • Published

@teamteanpm2024/fugiat-asperiores-placeat

A wrapper around the native DataView which can handle multiple ArrayBuffers.

version

This module provides a wrapper around the native DataView. But instead of supporting only one ArrayBuffer as the backing memory the MultiBufferDataView exported by this module can operate across multiple ArrayBuffers.

Usage

The @teamteanpm2024/fugiat-asperiores-placeat module is available on npm and can be installed as usual.

npm install @teamteanpm2024/fugiat-asperiores-placeat

It exports only one class called MultiBufferDataView which can be imported like this:

import { MultiBufferDataView } from '@teamteanpm2024/fugiat-asperiores-placeat';

A MultiBufferDataView behaves almost like a native DataView with the notable exception that it can handle multiple ArrayBuffers.

const anArrayBuffer = new ArrayBuffer(23);
const anotherArrayBuffer = new ArrayBuffer(41);

new MultiBufferDataView([anArrayBuffer, anotherArrayBuffer]);

The little example above will create a MultiBufferDataView which uses all 64 bytes that are available in the given ArrayBuffers. However it is also possible to limit the range of accessible bytes by providing a byteOffset or a byteLength as additional arguments.

new MultiBufferDataView([anArrayBuffer, anotherArrayBuffer], 12, 24);

When creating a MultiBufferDataView with the parameters above it will only use the last 11 bytes of the first ArrayBuffer and the first 13 bytes of the second ArrayBuffer.

/@teamteanpm2024/fugiat-asperiores-placeat/

    Package Sidebar

    Install

    npm i @teamteanpm2024/fugiat-asperiores-placeat

    Weekly Downloads

    6

    Version

    1.1.4

    License

    MIT

    Unpacked Size

    11.7 kB

    Total Files

    7

    Last publish

    Collaborators

    • shivamkalsi2024