-
Notifications
You must be signed in to change notification settings - Fork 1
Create linked lists of Buffer objects
License
pkrumins/node-bufferlist
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Hackneyed Example: var sys = require('sys'); var Buffer = require('buffer').Buffer; var BufferList = require('bufferlist').BufferList; var buf1 = new Buffer(5); buf1.write('abcde'); var buf2 = new Buffer(3); buf2.write('xyz'); var buf3 = new Buffer(5); buf3.write('11358'); var b = new BufferList; b.push(buf1,buf2,buf3); sys.puts(b.take(10)); // abcdexyz11 sys.puts(b.take(3)); // abc sys.puts(b.take(100)); // abcdexyz11358 Buffer objects don't need to be buffer objects necessarily, but they should implement methods that act like Buffer's toString, length, and copy. To use a different kind of buffer object, set the constructor property: var b = new BufferList({ construct : Bluffer }); var b = new BufferList; b.construct = Buffur;
About
Create linked lists of Buffer objects
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published