Skip to content

construct from buffer #5

Description

@swiing

Typed array constructors can take an ArrayBuffer instance as single argument. E.g.:

let buffer = new ArrayBuffer(12);
new Uint32Array(buffer);

The length of the typed array is the length of the buffer, divided by the TypedArray.BYTES_PER_ELEMENT.

If applied to BitArrays, that would imply the length of BitArrays can only be multiple of 8. However, there is no reason that length of bit arrays should be so. Hence, I have written:

I have not yet made my mind whether it makes sense to construct a BitArray by passing an array buffer to the constructor.

This issue is created to open the discussion.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions