diff options
author | asynts <asynts@gmail.com> | 2020-08-18 18:04:17 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-20 16:28:31 +0200 |
commit | 30abadcff947feaf9e8c3e968f622bcfdd9b2c1f (patch) | |
tree | c7c8e262f95622fc0cb9f89e676859218f865879 /Libraries | |
parent | a15556638d996997d37aa941943e4af201b0e6a1 (diff) | |
download | serenity-30abadcff947feaf9e8c3e968f622bcfdd9b2c1f.zip |
AK: Add DuplexMemoryStream class.
This class is similar to BufferStream because it is possible to both
read and write to it. However, it differs in the following ways:
- DuplexMemoryStream keeps a history of 64KiB and discards the rest,
BufferStream always keeps everything around.
- DuplexMemoryStream tracks reading and writing seperately, the
following is valid:
DuplexMemoryStream stream;
stream << 42;
int value;
stream >> value;
For BufferStream it would read:
BufferStream stream;
stream << 42;
int value;
stream.seek(0);
stream >> value;
In the future I would like to replace all usages of BufferStream with
InputMemoryStream, OutputMemoryStream (doesn't exist yet) and
DuplexMemoryStream. For now I just add DuplexMemoryStream though.
Diffstat (limited to 'Libraries')
0 files changed, 0 insertions, 0 deletions