From 51ecba8da9c8c9d974be9c01370c1bdd37031b1f Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 19 Aug 2010 23:29:06 -0700 Subject: [PATCH] Add get/set methods to Buffer --- lib/buffer.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/buffer.js b/lib/buffer.js index e9fb033f93d..85c0bfece81 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -78,4 +78,12 @@ Buffer.prototype.write = function (string, offset, encoding) { default: throw new Error('Unknown encoding'); } -}; \ No newline at end of file +}; + +Buffer.prototype.get = function (index) { + return this[index]; +}; + +Buffer.prototype.set = function (index, value) { + return this[index] = value; +};