1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

gunzip+LibCompress: Increase buffer sizes used by Deflate and gunzip

Co-authored-by: Andreas Kling <kling@serenityos.org>
This commit is contained in:
Timothy Flynn 2023-03-30 14:01:07 -04:00 committed by Andreas Kling
parent 62b575ad7c
commit 9f238793e0
3 changed files with 5 additions and 5 deletions

View file

@ -15,7 +15,7 @@ static ErrorOr<void> decompress_file(NonnullOwnPtr<Stream> input_stream, Stream&
{
auto gzip_stream = Compress::GzipDecompressor { move(input_stream) };
auto buffer = TRY(ByteBuffer::create_uninitialized(4096));
auto buffer = TRY(ByteBuffer::create_uninitialized(256 * KiB));
while (!gzip_stream.is_eof()) {
auto span = TRY(gzip_stream.read_some(buffer));
TRY(output_stream.write_until_depleted(span));
@ -52,7 +52,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
}
auto input_file = TRY(Core::File::open(input_filename, Core::File::OpenMode::Read));
auto buffered_input_file = TRY(Core::BufferedFile::create(move(input_file)));
auto buffered_input_file = TRY(Core::BufferedFile::create(move(input_file), 256 * KiB));
auto output_stream = write_to_stdout ? TRY(Core::File::standard_output()) : TRY(Core::File::open(output_filename, Core::File::OpenMode::Write));