bytebuffer
ByteBuffer.js: A Java-like, Netty-inspired ByteBuffer implementation using typed arrays.
Last updated 13 years ago by dcode .
Apache License, Version 2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install bytebuffer 
SYNC missed versions from official npm registry.

bytebuffer.js - The swiss army knife for binary data in JavaScript.

A fast and complete ByteBuffer implementation using either ArrayBuffers in the browser or node Buffers under node.js, generated from a single source tree through MetaScript.

Build Status Donate

Features

  • Three API-compatible versions:
    • bytebuffer   Backing buffer: ArrayBuffer, Accessor: Uint8Array
    • bytebuffer-dataview   Backing buffer: ArrayBuffer, Accessor: DataView
    • bytebuffer-node   Backing buffer / Accessor: node Buffer
  • 8, 16, 32 and 64 bit (through long.js) signed and unsigned integers
  • 32 and 64 bit floats
  • Varints as used in protobuf (32 and 64 bit, zig-zag)
  • Base64, utf8, binary, hex and debug encodings
  • Handy string and debugging utilities
  • Big and little endianness
  • Relative and absolute zero-copy operations wherever possible
  • Transparent resizing when using unknown-length data
  • Chaining of all operations that do not return a specific value
  • Slicing, appending, prepending, reversing, flip, mark, reset, etc.

Usage

The library is compatible with CommonJS and AMD loaders and is exposed globally as dcodeIO.ByteBuffer if neither is available.

var ByteBuffer = require("bytebuffer");

var bb = new ByteBuffer()
            .writeIString("Hello world!")
            .flip();
console.log(bb.readIString()+" from bytebuffer.js");

In the browser, 64 bit integer support is optional and present only if Long.js has been loaded prior to bytebuffer.js.

API

Downloads

Support for IE<10, FF<15, Chrome<9 etc.

  • Use bytebuffer-dataview with a polyfill (see)

Contributors

Dretch (IE8 compatibility)

License

License: Apache License, Version 2.0 - Logo derived from W3C HTML5 Logos (CC A 3.0)

Current Tags

  • 5.0.1                                ...           latest (10 years ago)

68 Versions

  • 5.0.1                                ...           10 years ago
  • 5.0.0                                ...           10 years ago
  • 4.1.0                                ...           11 years ago
  • 4.0.0                                ...           11 years ago
  • 3.5.5                                ...           11 years ago
  • 3.5.4                                ...           11 years ago
  • 3.5.3                                ...           11 years ago
  • 3.5.2                                ...           11 years ago
  • 3.5.1                                ...           11 years ago
  • 3.5.0                                ...           11 years ago
  • 3.4.0                                ...           12 years ago
  • 3.3.0                                ...           12 years ago
  • 3.2.3                                ...           12 years ago
  • 3.2.2                                ...           12 years ago
  • 3.2.1                                ...           12 years ago
  • 3.2.0                                ...           12 years ago
  • 2.3.2                                ...           12 years ago
  • 3.1.1-1                                ...           12 years ago
  • 3.1.1                                ...           12 years ago
  • 3.1.0                                ...           12 years ago
  • 3.0.3                                ...           12 years ago
  • 3.0.2                                ...           12 years ago
  • 3.0.1                                ...           12 years ago
  • 3.0.0                                ...           12 years ago
  • 3.0.0-RC2                                ...           12 years ago
  • 3.0.0-RC1                                ...           12 years ago
  • 2.3.1                                ...           12 years ago
  • 2.3.0                                ...           12 years ago
  • 2.2.0                                ...           12 years ago
  • 2.1.1                                ...           12 years ago
  • 2.1.0                                ...           12 years ago
  • 2.0.2                                ...           12 years ago
  • 2.0.1                                ...           12 years ago
  • 2.0.0                                ...           12 years ago
  • 1.6.1                                ...           12 years ago
  • 1.6.0                                ...           12 years ago
  • 1.5.0                                ...           12 years ago
  • 1.4.1                                ...           13 years ago
  • 1.3.8                                ...           13 years ago
  • 1.3.7                                ...           13 years ago
  • 1.3.6                                ...           13 years ago
  • 1.3.5                                ...           13 years ago
  • 1.3.4                                ...           13 years ago
  • 1.3.3                                ...           13 years ago
  • 1.3.2                                ...           13 years ago
  • 1.3.1                                ...           13 years ago
  • 1.3.0                                ...           13 years ago
  • 1.2.3                                ...           13 years ago
  • 1.2.2                                ...           13 years ago
  • 1.2.1                                ...           13 years ago
  • 1.2.0                                ...           13 years ago
  • 1.1.5                                ...           13 years ago
  • 1.1.4                                ...           13 years ago
  • 1.1.3                                ...           13 years ago
  • 1.1.2                                ...           13 years ago
  • 1.1.1                                ...           13 years ago
  • 1.1.0                                ...           13 years ago
  • 1.0.5                                ...           13 years ago
  • 1.0.4                                ...           13 years ago
  • 1.0.3                                ...           13 years ago
  • 1.0.2                                ...           13 years ago
  • 1.0.1                                ...           13 years ago
  • 1.0.0                                ...           13 years ago
  • 0.9.4                                ...           13 years ago
  • 0.9.3                                ...           13 years ago
  • 0.9.1                                ...           13 years ago
  • 0.9.0                                ...           13 years ago
  • 0.0.0                                ...           13 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 5
Last Month 6
Dependencies (1)
Dev Dependencies (3)

Copyright 2013 - present © cnpmjs.org | Home |