diff --git a/AK/ByteBuffer.h b/AK/ByteBuffer.h index ce160e32a3..106f650841 100644 --- a/AK/ByteBuffer.h +++ b/AK/ByteBuffer.h @@ -182,6 +182,11 @@ public: return try_ensure_capacity_slowpath(new_capacity); } + void append(char byte) + { + MUST(try_append(byte)); + } + void append(ReadonlyBytes bytes) { MUST(try_append(bytes)); @@ -189,6 +194,11 @@ public: void append(void const* data, size_t data_size) { append({ data, data_size }); } + ErrorOr try_append(char byte) + { + return try_append(&byte, 1); + } + ErrorOr try_append(ReadonlyBytes bytes) { return try_append(bytes.data(), bytes.size());