Add AppendOnlyStreamSource, adjust examples to use it

This commit is contained in:
Vanilagy
2026-04-21 14:58:33 +02:00
parent 2b3e5f45c6
commit 783cfa6fbe
17 changed files with 328 additions and 68 deletions
+2 -6
View File
@@ -16,8 +16,9 @@ export class Writer {
private pos = 0;
constructor(target: Target) {
constructor(target: Target, isMonotonic: boolean) {
this.target = target;
target._setMonotonicity(isMonotonic);
}
start() {
@@ -26,11 +27,6 @@ export class Writer {
this.started = true;
}
ensureMonotonicity() {
this.target._ensureMonotonicity = true;
// Note that this currently is without effect for RangedTarget. But, should be fine since its use is rare
}
/** Writes the given data to the target, at the current position. */
write(data: Uint8Array) {
assert(this.started && !this.finalized);