function constructor(arrayBuffer) {
this.bytes = Uint8Array(arrayBuffer);
this.pos = 0;
+ this.start = 0;
}
constructor.prototype = {
return this.bytes.length;
},
reset: function() {
- this.pos = 0;
+ this.pos = this.start;
},
lookChar: function() {
var bytes = this.bytes;
this.pos += n;
},
moveStart: function() {
- this.bytes = Uint8Array(this.bytes, this.pos);
- this.pos = 0;
+ this.start = this.pos;
},
find: function(needle, limit, backwards) {
var length = this.bytes.length;