Skip to content

Commit

Permalink
Add get/set methods to Buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Aug 20, 2010
1 parent 0c20c58 commit 51ecba8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/buffer.js
Expand Up @@ -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.