Targa file extractor

This commit is contained in:
n1073645 2020-03-16 16:56:01 +00:00
parent 75da5b650c
commit dbcd670ca8
2 changed files with 121 additions and 3 deletions

View file

@ -303,11 +303,13 @@ export default class Stream {
/**
* Returns a slice of the stream up to the current position.
*
* @param {number} [start=0]
* @param {number} [finish=this.position]
* @returns {Uint8Array}
*/
carve() {
if (this.bitPos > 0) this.position++;
return this.bytes.slice(0, this.position);
carve(start=0, finish=this.position) {
if (this.bitPos > 0) finish++;
return this.bytes.slice(start, finish);
}
}