Files
react-native-devtools-frontend/front_end/core/common/StringOutputStream.ts
T
Alina Varkki 2fc2ce88e3 Parse the whole trace file at once instead of chunking
Set the size of a chunk to Number.MAX_VALUE to get the whole file at once and parse it.
Removed all the states we had for reading the file and logic for reading it in chunks.

Bug: 313757110
Change-Id: I9fe7ea3517a16517e85582e0d6009d9c032862b1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5382164
Commit-Queue: Alina Varkki <alinavarkki@chromium.org>
Reviewed-by: Paul Irish <paulirish@chromium.org>
2024-03-22 11:43:20 +00:00

27 lines
599 B
TypeScript

// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
export interface OutputStream {
write(data: string, endOfFile?: boolean): Promise<void>;
close(): Promise<void>;
}
export class StringOutputStream implements OutputStream {
#dataInternal: string;
constructor() {
this.#dataInternal = '';
}
async write(chunk: string): Promise<void> {
this.#dataInternal += chunk;
}
async close(): Promise<void> {
}
data(): string {
return this.#dataInternal;
}
}