mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 04:55:15 +00:00
AK: Add a ByteBuffer::copy(ReadonlyBytes) overload
This commit is contained in:
parent
e7e5a5e677
commit
bf7cda414f
Notes:
sideshowbarker
2024-07-19 00:23:23 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/bf7cda414fa Pull-request: https://github.com/SerenityOS/serenity/pull/4526
1 changed files with 1 additions and 0 deletions
|
@ -123,6 +123,7 @@ public:
|
|||
static ByteBuffer create_uninitialized(size_t size) { return ByteBuffer(ByteBufferImpl::create_uninitialized(size)); }
|
||||
static ByteBuffer create_zeroed(size_t size) { return ByteBuffer(ByteBufferImpl::create_zeroed(size)); }
|
||||
static ByteBuffer copy(const void* data, size_t size) { return ByteBuffer(ByteBufferImpl::copy(data, size)); }
|
||||
static ByteBuffer copy(ReadonlyBytes bytes) { return ByteBuffer(ByteBufferImpl::copy(bytes.data(), bytes.size())); }
|
||||
|
||||
~ByteBuffer() { clear(); }
|
||||
void clear() { m_impl = nullptr; }
|
||||
|
|
Loading…
Add table
Reference in a new issue