(size: number)
| 23 | return (await this.get8BitArray(1))[0]; |
| 24 | } |
| 25 | async get8BitArray(size: number) { |
| 26 | if (!this.read) throw new Error("not ready to read"); |
| 27 | this.sizeLeft -= size; |
| 28 | const arr = new Uint8Array(size); |
| 29 | let arri = 0; |
| 30 | while (size > 0) { |
| 31 | if (!this.cbuff) throw Error("ran out of file to read"); |
| 32 | let itter = Math.min(size, this.cbuff.length - this.index); |
| 33 | size -= itter; |
| 34 | for (let i = 0; i < itter; i++, arri++, this.index++) { |
| 35 | arr[arri] = this.cbuff[this.index]; |
| 36 | } |
| 37 | |
| 38 | if (size !== 0) { |
| 39 | this.cbuff = (await this.read.read()).value; |
| 40 | this.index = 0; |
| 41 | } |
| 42 | } |
| 43 | return arr; |
| 44 | } |
| 45 | decoder = new TextDecoder(); |
| 46 | backChar?: string; |
| 47 | chars = ""; |
no outgoing calls
no test coverage detected