npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@holzchopf/array-buffer-stream

v1.0.1

Published

Make an ArrayBuffer readable/writable like a stream.

Downloads

1

Readme

This file was auto-generated with zdoccer.js 2.0.3

Index


original Markdown from src/_preamble.md

@holzchopf/array-buffer-stream

Provides a wrapper class that lets you access an ArrayBuffer like a stream, i.e. every read/write operation will move the cursor by the number of bytes read/written.


transformed Javadoc from src/array-buffer-stream.ts

class ArrayBufferStream

Main ArrayBufferStream class.

buffer: ArrayBuffer

Underlying ArrayBuffer.

cursor = 0

Read/write position.

constructor(buffer: ArrayBuffer)

Creates an ArrayBufferStream from an existing ArrayBuffer.

eof(): boolean

Returns whether the end of the stream is reached.

append(buffer: ArrayBuffer)

Creates a new ArrayBuffer from this stream's buffer and the given one and sets it as this stream's buffer.

  • param buffer — ArrayBuffer to append.

readBytes(byteLength: number): ArrayBuffer

Reads a number of bytes and returns them as ArrayBuffer copy.

  • param byteLength — Bytes to read.

readUint8()

Reads the next byte as unsigned 8 bit integer and returns it as number.

readUint16(littleEndian?: boolean | undefined)

Reads the next bytes as unsigned 16 bit integer and returns it as number.

  • param littleEndian — If true, a little-endian value should be read.

readUint32(littleEndian?: boolean | undefined)

Reads the next bytes as unsigned 32 bit integer and returns it as number.

  • param littleEndian — If true, a little-endian value should be read.

readBigUint64(littleEndian?: boolean | undefined)

Reads the next bytes as unsigned 64 bit integer and returns it as bigint.

  • param littleEndian — If true, a little-endian value should be read.

readUleb128()

Reads the next bytes as unsigned LEB128 value and returns it as number.

readInt8()

Reads the next byte as signed 8 bit integer and returns it as number.

readInt16(littleEndian?: boolean | undefined)

Reads the next bytes as signed 16 bit integer and returns it as number.

  • param littleEndian — If true, a little-endian value should be read.

readInt32(littleEndian?: boolean | undefined)

Reads the next bytes as signed 32 bit integer and returns it as number.

  • param littleEndian — If true, a little-endian value should be read.

readBigInt64(littleEndian?: boolean | undefined)

Reads the next bytes as signed 64 bit integer and returns it as bigint.

  • param littleEndian — If true, a little-endian value should be read.

readLeb128()

Reads the next bytes as signed LEB128 value and returns it as number.

readFloat32(littleEndian?: boolean | undefined)

Reads the next bytes as 32 bit float and returns it as number.

  • param littleEndian — If true, a little-endian value should be read.

readFloat64(littleEndian?: boolean | undefined)

Reads the next bytes as 64 bit float and returns it as number.

  • param littleEndian — If true, a little-endian value should be read.

readAsciiString(byteLength: number)

Reads a number of bytes as ASCII string and returns it as string.

  • param byteLength — Bytes to read.

readUtf8String(byteLength: number)

Reads a number of bytes as UTF8 string and returns it as string.

  • param byteLength — Bytes to read.

readUtf16String(byteLength: number, littleEndian?: boolean | undefined)

Reads a number of bytes as UTF16 string and returns it as string.

  • param byteLength — Bytes to read.
  • param littleEndian — If true, a little-endian value should be read.

writeBytes(bytes: ArrayBuffer)

Writes multiple bytes.

  • param bytes — Bytes to write.

writeUint8(value: number)

Writes an unsigned 8 bit integer.

  • param value — The value to write.

writeUint16(value: number, littleEndian?: boolean | undefined)

Writes an unsigned 16 bit integer.

  • param value — The value to write.
  • param littleEndian — If true, a little-endian value should be written.

writeUint32(value: number, littleEndian?: boolean | undefined)

Writes an unsigned 32 bit integer.

  • param value — The value to write.
  • param littleEndian — If true, a little-endian value should be written.

writeBigUint64(value: bigint, littleEndian?: boolean | undefined)

Writes an unsigned 64 bit big integer.

  • param value — The value to write.
  • param littleEndian — If true, a little-endian value should be written.

writeUleb128(value: number)

Writes an unsigned LEB128 value.

  • param value — The value to write.

writeInt8(value: number)

Writes a signed 8 bit integer.

  • param value — The value to write.

writeInt16(value: number, littleEndian?: boolean | undefined)

Writes a signed 16 bit integer.

  • param value — The value to write.
  • param littleEndian — If true, a little-endian value should be written.

writeInt32(value: number, littleEndian?: boolean | undefined)

Writes a signed 32 bit integer.

  • param value — The value to write.
  • param littleEndian — If true, a little-endian value should be written.

writeBigInt64(value: bigint, littleEndian?: boolean | undefined)

Writes a signed 64 bit big integer.

  • param value — The value to write.
  • param littleEndian — If true, a little-endian value should be written.

writeLeb128(value: number)

Writes a signed LEB128 value.

  • param value — The value to write.

writeFloat32(value: number, littleEndian?: boolean | undefined)

Writes a 32 bit float.

  • param value — The value to write.
  • param littleEndian — If true, a little-endian value should be written.

writeFloat64(value: number, littleEndian?: boolean | undefined)

Writes a 64 bit float.

  • param value — The value to write.
  • param littleEndian — If true, a little-endian value should be written.

writeAsciiString(string: string)

Writes a string as ASCII string.

  • param string — String to write.

writeUtf8String(string: string)

Writes a string as UTF-8 string.

  • param string — String to write.

writeUtf16String(string: string, littleEndian?: boolean | undefined)

Writes a string as UTF-16 string.

  • param string — String to write.

transformed Javadoc from src/join-array-buffers.ts

function joinArrayBuffers(buffers: ArrayBuffer[]): ArrayBuffer

Creates and returns a new ArrayBuffer by concatenating all of the buffers provided.

  • param buffers — ArrayBuffers to join.