projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0c20c58
)
Add get/set methods to Buffer
author
Ryan Dahl
<ry@tinyclouds.org>
Fri, 20 Aug 2010 06:29:06 +0000
(23:29 -0700)
committer
Ryan Dahl
<ry@tinyclouds.org>
Fri, 20 Aug 2010 06:29:06 +0000
(23:29 -0700)
lib/buffer.js
patch
|
blob
|
history
diff --git
a/lib/buffer.js
b/lib/buffer.js
index
e9fb033
..
85c0bfe
100644
(file)
--- 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;
+};