fill and seek.

This commit is contained in:
Christopher Jeffrey 2016-05-16 15:27:33 -07:00
parent 6e97a7d431
commit 7e4ac9b0ed
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -72,6 +72,11 @@ BufferWriter.prototype.render = function render(keep) {
case 'checksum':
off += utils.checksum(data.slice(0, off)).copy(data, off);
break;
// case 'seek': off += item[1]; break;
// case 'fill':
// item[1].fill(item[1], off, off + item[2]);
// off += item[2];
// break;
}
}
@ -354,6 +359,21 @@ BufferWriter.prototype.fill = function fill(value, size) {
this.data.push(['bytes', buf]);
};
// BufferWriter.prototype.fill = function fill(value, size) {
// assert(size >= 0);
// this.written += size;
// this.data.push(['fill', value, size]);
// };
/*
* Seek to relative offset.
* @param {Number} offset
*/
// BufferWriter.prototype.seek = function seek(offset) {
// this.data.push(['seek', offset]);
// };
/**
* Write float le.
* @param {Number} value