From aee2f25929157a4e6c7f391584c4839a40beadc8 Mon Sep 17 00:00:00 2001 From: Diego <96022404+dzfrias@users.noreply.github.com> Date: Mon, 8 Jul 2024 19:04:10 -0700 Subject: [PATCH] AK: Add `remaining` method to `ConstrainedStream` Simply returns how many bytes can be read from the stream. --- AK/ConstrainedStream.h | 1 + 1 file changed, 1 insertion(+) diff --git a/AK/ConstrainedStream.h b/AK/ConstrainedStream.h index 087c32594ff..7ef92b26382 100644 --- a/AK/ConstrainedStream.h +++ b/AK/ConstrainedStream.h @@ -22,6 +22,7 @@ public: virtual bool is_eof() const override; virtual bool is_open() const override; virtual void close() override; + u64 remaining() const { return m_limit; } private: MaybeOwned m_stream;