binary-stream

0.0.1 • Public • Published

binary-stream

A stream of binary values separated by a fixed length header, containing the chunk size. So you can stream a list of binary values.

See node-binary for details.

serialize

    var binaryStream= require('binary-stream'),
        bin= binaryStream.serialize();
 
    bin.pipe(process.stdout);
 
    bin.write(new Buffer('andrea','utf8'));
    bin.write(new Buffer(Array(100).join('andrea'),'utf8'));
    bin.write(new Buffer('elena','utf8'));
    bin.end();

deserialize

    var binaryStream= require('binary-stream');
 
    process.stdin.pipe(binaryStream.deserialize())
                 .on('data',function (data)
                 {
                    console.log(data.toString('utf8'));
                 });

Readme

Keywords

Package Sidebar

Install

npm i binary-stream

Weekly Downloads

1

Version

0.0.1

License

Apache2

Last publish

Collaborators

  • aaaristo