Browse Source

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

v0.9.4-release
isaacs 12 years ago
parent
commit
639fbe28d1
  1. 2
      lib/_stream_writable.js

2
lib/_stream_writable.js

@ -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;

Loading…
Cancel
Save