export class OutputBuffer {
    chunks = [];
    byteLength = 0;
    push(chunk) {
        if (chunk) {
            this.chunks.push(chunk);
            this.byteLength += chunk.length;
        }
    }
    toString() {
        return this.chunks.join("");
    }
    get length() {
        return this.byteLength;
    }
    get isEmpty() {
        return this.chunks.length === 0;
    }
    clear() {
        this.chunks = [];
        this.byteLength = 0;
    }
}
