1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:07:34 +00:00

AK: Add OutputMemoryStream::fill_to_end.

This commit is contained in:
asynts 2020-09-15 12:18:31 +02:00 committed by Andreas Kling
parent 83d0803861
commit c8ed882b8e
2 changed files with 11 additions and 3 deletions

View file

@ -186,6 +186,13 @@ public:
return true;
}
size_t fill_to_end(u8 value)
{
const auto nwritten = m_bytes.slice(m_offset).fill(value);
m_offset += nwritten;
return nwritten;
}
ReadonlyBytes bytes() const { return { data(), size() }; }
Bytes bytes() { return { data(), size() }; }