Skip to content

nbqx/fixed-size-buffer-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fixed size buffer stream

pushing fixed size buffer transform stream

usage

var fs = require('fs');
var fsb = require(__dirname);
var through2 = require('through2');

var inp = fs.createReadStream(__dirname+'/test.dat');

// each 10000 bytes
var push = fsb(10000);
inp.pipe(push)
  .pipe(through2(function(buf,enc,next){
    console.log(buf.length); // each size buffer and the rest
    next();
  }));

output:

10000
10000
10000
10000
...
7730

see also example.js

About

pushing fixed size buffer transform stream

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published