inflate-until

take buffer chunks until the inflated result is === size

6 个版本
安装
npm install inflate-until
yarn add inflate-until
pnpm add inflate-until
bun add inflate-until
README

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, function(err, info) {
  stream.rest // the remaining contents of the 
              // last buffer

  info.compressed // the compressed size
  info.data // the inflated data
})

inflateUntil.write(buf)
inflateUntil.write(buf)
inflateUntil.write(buf)
inflateUntil.write(buf)

API

inflateUntil(size[, ready(err, info)]) -> stream

create an inflateUntil stream.

stream.rest

the remaining bytes of the last buffer written.

License

MIT

版本列表
0.0.6 2013-04-02
0.0.5 2013-04-01
0.0.4 2013-04-01
0.0.3 2013-03-25
0.0.2 2013-03-24
0.0.1 2013-03-24