Browse Source

Add get/set methods to Buffer

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
51ecba8da9
  1. 10
      lib/buffer.js

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;
};

Loading…
Cancel
Save