diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-08-20 10:29:06 +0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-08-20 10:29:06 +0400 |
commit | 51ecba8da9c8c9d974be9c01370c1bdd37031b1f (patch) | |
tree | 515c8c2e6ab5c478ea4cb2b4b07dd576e7a49904 | |
parent | 0c20c588af8eeebdbf21b703934563f5c91c48dd (diff) |
Add get/set methods to Buffer
-rw-r--r-- | lib/buffer.js | 10 |
1 files changed, 9 insertions, 1 deletions
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; +}; |