2013-07-18 09:01:12 -07:00
|
|
|
exports.patch = function(Buffers) {
|
|
|
|
Buffers.prototype.skip = function (i) {
|
|
|
|
if (i == 0) {
|
|
|
|
return;
|
|
|
|
} else if (i == this.length) {
|
|
|
|
this.buffers = [];
|
|
|
|
this.length = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
var pos = this.pos(i);
|
|
|
|
this.buffers = this.buffers.slice(pos.buf);
|
2014-04-10 14:52:13 -07:00
|
|
|
this.buffers[0] = new Buffer(this.buffers[0].slice(pos.offset));
|
2013-07-18 09:01:12 -07:00
|
|
|
this.length -= i;
|
|
|
|
};
|
|
|
|
};
|