Git Product home page Git Product logo

node-ropebuffer's Introduction

Node-RopeBuffer

Zero-copy dynamic buffer, implemented by using a rope-like data-structure. (A list of buffers, in case anybody is curious).

Reading and writing is done using a cursor and various functions working at the cursor. Currently, .seek(), .tell and index-less versions of {read,write}{U,}Int{8,16,32} is implemented.

API

var rb = new RopeBuffer(10); // Same initializers as regular buffers
rb.tell; // = 0 - Reading/writing/seeking has happened.
rb.writeUInt8(20); // Write something.
rb.tell; // = 1 - Just wrote one byte.

// Use absolute read/writes
rb.readUInt8At(0); // = 20; Doesn't move cursor.
rb.writeUInt8At(55, 0); // Overwrite first byte.

Most commands for writing/reading integers from buffers have been copied. As seen in the example, two versions are exposed; the "plain" one, using a cursor for indexing, and an At-suffixed version that uses absolute indices.

Also, this is all very α.

node-ropebuffer's People

Contributors

msiebuhr avatar pdiemert avatar

Watchers

gareth stokes avatar Josh Whybark avatar Chris Viau avatar James Cloos avatar  avatar Monbot Robotic Deployment avatar  avatar D avatar Jesse Hodges avatar Boundary Engineering avatar  avatar Pearce Barry avatar David Gwartney avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.