streams2: Convert strings to buffers before passing to _write()

This commit is contained in:
isaacs 2012-10-02 16:28:02 -07:00
parent 420e07c577
commit 639fbe28d1

View File

@ -65,7 +65,7 @@ Writable.prototype.write = function(chunk, encoding) {
return;
}
if (typeof chunk === 'string' && encoding)
if (typeof chunk === 'string')
chunk = new Buffer(chunk, encoding);
var ret = state.length >= state.highWaterMark;