mirror of https://github.com/nodejs/node.git
Add get/set methods to Buffer
parent
0c20c588af
commit
51ecba8da9
|
@ -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…
Reference in New Issue