Add openttd support

This commit is contained in:
Michael Morrison 2014-11-18 00:43:33 -06:00
parent b8d41ef318
commit 0fe80d14e7
5 changed files with 165 additions and 2 deletions

View file

@ -110,6 +110,16 @@ Reader.prototype = {
this.i += 4;
return r;
},
part: function(bytes) {
var r;
if(this.remaining() >= bytes) {
r = this.buffer.slice(this.i,this.i+bytes);
} else {
r = new Buffer();
}
this.i += bytes;
return r;
},
remaining: function() {
return this.buffer.length-this.i;
},