bitreader
Generic, space efficient (uses Buffer#slice
as much as possilbe)
parser with sugar for digesting strings, ints, etc. Inherits from
stream, implements write
and end
, and emits data
events for easy
piping.
Install
$ npm install bitreader
Example
Adapted from streampng
{ thisintialize }SuggestedPaletteprototype { var colourSize chunkSize; var parser = ; thistype = 'sPLT' thispaletteName = parser; thissampleDepth = parser; thispalette = ; colourSize = thissampleDepth === 16 ? 2 : 1; chunkSize = colourSize === 2 ? 10 : 6 thispalette = parser;};
API
Tests
Uses tap for testing. Tested against node 0.6.19 and node 0.8.2.
$ npm test