io/BufferedOutputStream: add method Discard()

This commit is contained in:
Max Kellermann 2020-09-07 12:52:29 +02:00 committed by Max Kellermann
parent d2f84f3df8
commit 56997290d7
1 changed files with 7 additions and 0 deletions

View File

@ -111,6 +111,13 @@ public:
*/
void Flush();
/**
* Discard buffer contents.
*/
void Discard() noexcept {
buffer.Clear();
}
private:
bool AppendToBuffer(const void *data, std::size_t size) noexcept;