ladybird/Libraries/LibCompress
asynts 96edcbc27c AK: Lower the requirements for InputStream::eof and rename it.
Consider the following snippet:

    void foo(InputStream& stream) {
        if(!stream.eof()) {
            u8 byte;
            stream >> byte;
        }
    }

There is a very subtle bug in this snippet, for some input streams eof()
might return false even if no more data can be read. In this case an
error flag would be set on the stream.

Until now I've always ensured that this is not the case, but this made
the implementation of eof() unnecessarily complicated.
InputFileStream::eof had to keep a ByteBuffer around just to make this
possible. That meant a ton of unnecessary copies just to get a reliable
eof().

In most cases it isn't actually necessary to have a reliable eof()
implementation.

In most other cases a reliable eof() is avaliable anyways because in
some cases like InputMemoryStream it is very easy to implement.
2020-09-14 20:58:12 +02:00
..
CMakeLists.txt LibCompress: Implement gzip. 2020-08-30 09:56:10 +02:00
Deflate.cpp AK: Lower the requirements for InputStream::eof and rename it. 2020-09-14 20:58:12 +02:00
Deflate.h AK: Lower the requirements for InputStream::eof and rename it. 2020-09-14 20:58:12 +02:00
Gzip.cpp AK: Lower the requirements for InputStream::eof and rename it. 2020-09-14 20:58:12 +02:00
Gzip.h AK: Lower the requirements for InputStream::eof and rename it. 2020-09-14 20:58:12 +02:00
Zlib.cpp LibCompress: Return Optional from decompress_all method. 2020-09-11 16:07:45 +02:00
Zlib.h LibCompress: Return Optional from decompress_all method. 2020-09-11 16:07:45 +02:00