substack/stream-browserify — pull request #4 by maxogden (2013-12-19 22:39:02+00:00)
Title: upgrade ArrayBuffers and Uint8arrays into Buffers

I ran into the `Invalid non-string/buffer chunk` error from `writable.js` again today when trying to work with https://github.com/brianloveswords/fileliststream, which reads files in the browser as ArrayBuffers and then writes them to a writable stream.

This just wraps any Uint8Arrays or ArrayBuffers in `new Buffer()` so that they can be written.