throw new TypeError('Unknown encoding: ' + encoding);
}
- Buffer._charsWritten = SlowBuffer._charsWritten;
-
return ret;
};
Buffer.prototype.toJSON = function() {
- return Array.prototype.slice.call(this, 0);
+ return {
+ type: 'Buffer',
+ data: Array.prototype.slice.call(this, 0)
+ };
};