Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-08-20 10:29:06 +0400
committerRyan Dahl <ry@tinyclouds.org>2010-08-20 10:29:06 +0400
commit51ecba8da9c8c9d974be9c01370c1bdd37031b1f (patch)
tree515c8c2e6ab5c478ea4cb2b4b07dd576e7a49904
parent0c20c588af8eeebdbf21b703934563f5c91c48dd (diff)
Add get/set methods to Buffer
-rw-r--r--lib/buffer.js10
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;
+};