Add get/set methods to Buffer

pull/22966/head
Ryan Dahl 2010-08-19 23:29:06 -07:00
parent 0c20c588af
commit 51ecba8da9
1 changed files with 9 additions and 1 deletions

View File

@ -78,4 +78,12 @@ Buffer.prototype.write = function (string, offset, encoding) {
default:
throw new Error('Unknown encoding');
}
};
};
Buffer.prototype.get = function (index) {
return this[index];
};
Buffer.prototype.set = function (index, value) {
return this[index] = value;
};