diff options
author | asynts <asynts@gmail.com> | 2020-09-15 11:48:54 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-15 20:36:45 +0200 |
commit | f18e927827fc511f46a3a83208a49894918e0133 (patch) | |
tree | ce548d39b442fdb57c567a663d8e6bc265359fd1 /Libraries | |
parent | c9a3a5b488f2fcfa758973eea2351a39d54be677 (diff) | |
download | serenity-f18e927827fc511f46a3a83208a49894918e0133.zip |
AK: Remove OutputMemoryStream for DuplexMemoryStream.
OutputMemoryStream was originally a proxy for DuplexMemoryStream that
did not expose any reading API.
Now I need to add another class that is like OutputMemoryStream but only
for static buffers. My first idea was to make OutputMemoryStream do that
too, but I think it's much better to have a distinct class for that.
I originally wanted to call that class FixedOutputMemoryStream but that
name is really cumbersome and it's a bit unintuitive because
InputMemoryStream is already reading from a fixed buffer.
So let's just use DuplexMemoryStream instead of OutputMemoryStream for
any dynamic stuff and create a new OutputMemoryStream for static
buffers.
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibCompress/Deflate.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibCompress/Gzip.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibCompress/Deflate.cpp b/Libraries/LibCompress/Deflate.cpp index dcd058b69c..59f2d5c2be 100644 --- a/Libraries/LibCompress/Deflate.cpp +++ b/Libraries/LibCompress/Deflate.cpp @@ -307,7 +307,7 @@ Optional<ByteBuffer> DeflateDecompressor::decompress_all(ReadonlyBytes bytes) { InputMemoryStream memory_stream { bytes }; DeflateDecompressor deflate_stream { memory_stream }; - OutputMemoryStream output_stream; + DuplexMemoryStream output_stream; u8 buffer[4096]; while (!deflate_stream.has_any_error() && !deflate_stream.unreliable_eof()) { diff --git a/Libraries/LibCompress/Gzip.cpp b/Libraries/LibCompress/Gzip.cpp index de19a0ff3d..cbedc5843b 100644 --- a/Libraries/LibCompress/Gzip.cpp +++ b/Libraries/LibCompress/Gzip.cpp @@ -164,7 +164,7 @@ Optional<ByteBuffer> GzipDecompressor::decompress_all(ReadonlyBytes bytes) { InputMemoryStream memory_stream { bytes }; GzipDecompressor gzip_stream { memory_stream }; - OutputMemoryStream output_stream; + DuplexMemoryStream output_stream; u8 buffer[4096]; while (!gzip_stream.has_any_error() && !gzip_stream.unreliable_eof()) { |