()
| 1058 | let run: Array<Uint8Array> = [] |
| 1059 | let runLength = 0 |
| 1060 | const join = () => { |
| 1061 | if (run.length === 1) { |
| 1062 | out.push(run[0]) |
| 1063 | } else if (run.length > 1) { |
| 1064 | const joined = new Uint8Array(runLength) |
| 1065 | let at = 0 |
| 1066 | for (const chunk of run) { |
| 1067 | joined.set(chunk, at) |
| 1068 | at += chunk.length |
| 1069 | } |
| 1070 | out.push(joined) |
| 1071 | } |
| 1072 | run = [] |
| 1073 | runLength = 0 |
| 1074 | } |
| 1075 | for (const chunk of this.chunks) { |
| 1076 | if (chunk.length >= COPY_LIMIT) { |
| 1077 | join() |