mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-02 13:23:51 +02:00
Add NullTarget
This commit is contained in:
@@ -459,3 +459,24 @@ export class StreamTargetWriter extends Writer {
|
||||
return this.writer?.close();
|
||||
}
|
||||
}
|
||||
|
||||
export class NullTargetWriter extends Writer {
|
||||
private pos = 0;
|
||||
|
||||
write(data: Uint8Array) {
|
||||
this.maybeTrackWrites(data);
|
||||
this.pos += data.byteLength;
|
||||
}
|
||||
|
||||
getPos() {
|
||||
return this.pos;
|
||||
}
|
||||
|
||||
seek(newPos: number) {
|
||||
this.pos = newPos;
|
||||
}
|
||||
|
||||
async flush() {}
|
||||
async finalize() {}
|
||||
async close() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user