mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:17:35 +00:00
AK: Add CircularBuffer::flush_to_stream
In a similar fashion to what have been done with `fill_from_stream`, this new method allows to write CircularBuffer's data to a Stream without additional copies.
This commit is contained in:
parent
2a91245a96
commit
48b000a36c
2 changed files with 18 additions and 0 deletions
|
@ -28,6 +28,7 @@ public:
|
|||
Bytes read(Bytes bytes);
|
||||
ErrorOr<void> discard(size_t discarded_bytes);
|
||||
ErrorOr<size_t> fill_from_stream(Stream&);
|
||||
ErrorOr<size_t> flush_to_stream(Stream&);
|
||||
|
||||
/// Compared to `read()`, this starts reading from an offset that is `distance` bytes
|
||||
/// before the current write pointer and allows for reading already-read data.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue