streams2: Convert strings to buffers before passing to _write()
This commit is contained in:
parent
420e07c577
commit
639fbe28d1
@ -65,7 +65,7 @@ Writable.prototype.write = function(chunk, encoding) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof chunk === 'string' && encoding)
|
if (typeof chunk === 'string')
|
||||||
chunk = new Buffer(chunk, encoding);
|
chunk = new Buffer(chunk, encoding);
|
||||||
|
|
||||||
var ret = state.length >= state.highWaterMark;
|
var ret = state.length >= state.highWaterMark;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user