inflate-until
take buffer chunks until the inflated result is === size
Last updated 14 years ago by chrisdickinson .
MIT · Repository · Original npm · Tarball · package.json
$ npm install inflate-until 
SYNC missed versions from official npm registry.

inflate-until

a module for that really odd case where you know how big the thing you're deflating is, but you want to deflate it and know how big the compressed data was.

NB: this is slow.


var stream = inflateUntil(256)

inflateUntil.write(buf, function(info) {
  if(info) {

  }
})

API

inflateUntil(size) -> inflate

create an inflateUntil function.

inflate(buf, ready) -> undefined

add another buf to the available bytes. calls ready when finished -- if there was enough data to determine whether or not we've reached size + the adler checksum, ready will receive an info argument:

{ compressed: Number    // size of compressed bytes written
, rest: Buffer          // Buffer representing unused bytes
, data: Buffer }        // uncompressed data

License

MIT

Current Tags

  • 0.0.6                                ...           latest (14 years ago)

6 Versions

  • 0.0.6                                ...           14 years ago
  • 0.0.5                                ...           14 years ago
  • 0.0.4                                ...           14 years ago
  • 0.0.3                                ...           14 years ago
  • 0.0.2                                ...           14 years ago
  • 0.0.1                                ...           14 years ago
Maintainers (1)
Downloads
Total 14
Today 0
This Week 0
This Month 7
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE