0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 07:53:06 +01:00
nodejs/lib/buffer.js
2010-03-19 20:58:24 -07:00

21 lines
366 B
JavaScript

var Buffer = process.binding('buffer').Buffer;
exports.Buffer = Buffer;
Buffer.prototype.toString = function () {
return this.utf8Slice(0, this.length);
};
Buffer.prototype.toJSON = function () {
return this.utf8Slice(0, this.length);
/*
var s = "";
for (var i = 0; i < this.length; i++) {
s += this[i].toString(16) + " ";
}
return s;
*/
};