Permalink
Browse files

Add get/set methods to Buffer

  • Loading branch information...
1 parent 0c20c58 commit 51ecba8da9c8c9d974be9c01370c1bdd37031b1f @ry ry committed Aug 20, 2010
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/buffer.js
View
10 lib/buffer.js
@@ -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;
+};

0 comments on commit 51ecba8

Please sign in to comment.