There's actually no benefit to breaking up a *big* Buffer into smaller chunks for the purposes of streaming. Once that big buffer is in memory, you're better off just calling .write(buf) on the writable stream and writing the entire Buffer at once; libuv/the kernel will take care of flushing the buffer appropriately.
On Wed, Dec 12, 2012 at 6:53 PM, Martin Cooper <mfncoo...@gmail.com> wrote: > > > On Wed, Dec 12, 2012 at 5:36 PM, dhruvbird <dhruvb...@gmail.com> wrote: >> >> Hello, >> >> Is there a module that creates a ReadableStream given a Buffer, or >> something like if I write to the stream, it emits the 'data' event every >> time someone writes to it. > > > This one might fit the bill: > > https://github.com/mjijackson/bufferedstream > > -- > Martin Cooper > > >> I found 2 modules, both of which seem unrelated: >> >> https://github.com/dodo/node-bufferstream >> https://github.com/bnoordhuis/node-buffertools >> >> Regards, >> -Dhruv. >> >> -- >> Job Board: http://jobs.nodejs.org/ >> Posting guidelines: >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> You received this message because you are subscribed to the Google >> Groups "nodejs" group. >> To post to this group, send email to nodejs@googlegroups.com >> To unsubscribe from this group, send email to >> nodejs+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/nodejs?hl=en?hl=en > > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en