From 56997290d77cecb6f536f3422852ef3a2a0d3c1e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 7 Sep 2020 12:52:29 +0200 Subject: [PATCH] io/BufferedOutputStream: add method Discard() --- src/fs/io/BufferedOutputStream.hxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/fs/io/BufferedOutputStream.hxx b/src/fs/io/BufferedOutputStream.hxx index 88096bea9..b88be1bac 100644 --- a/src/fs/io/BufferedOutputStream.hxx +++ b/src/fs/io/BufferedOutputStream.hxx @@ -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;