mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:27:35 +00:00
AK: Remove BitStream workaround for now-resolved BufferedStream behavior
The issue was that the buffer would only be filled if it was empty.
This commit is contained in:
parent
13573a6c4b
commit
7319deb03d
1 changed files with 2 additions and 11 deletions
|
@ -234,19 +234,10 @@ private:
|
|||
size_t bytes_to_read = bits_to_read / bits_per_byte;
|
||||
|
||||
BufferType buffer = 0;
|
||||
|
||||
Bytes bytes { &buffer, bytes_to_read };
|
||||
size_t bytes_read = 0;
|
||||
|
||||
// FIXME: When the underlying stream is buffered, `read_some` seems to stop before EOF.
|
||||
do {
|
||||
auto result = TRY(m_stream->read_some(bytes));
|
||||
bytes = bytes.slice(result.size());
|
||||
bytes_read += result.size();
|
||||
} while (!bytes.is_empty() && !m_stream->is_eof());
|
||||
auto bytes = TRY(m_stream->read_some({ &buffer, bytes_to_read }));
|
||||
|
||||
m_bit_buffer = (buffer << m_bit_count) | lsb_aligned_buffer();
|
||||
m_bit_count += bytes_read * bits_per_byte;
|
||||
m_bit_count += bytes.size() * bits_per_byte;
|
||||
m_bit_offset = 0;
|
||||
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue