diff --git a/wpiutil/src/main/native/include/wpi/uv/Buffer.h b/wpiutil/src/main/native/include/wpi/uv/Buffer.h index a0afbe4b44..b500c0f1d4 100644 --- a/wpiutil/src/main/native/include/wpi/uv/Buffer.h +++ b/wpiutil/src/main/native/include/wpi/uv/Buffer.h @@ -67,6 +67,12 @@ class Buffer : public uv_buf_t { return buf; } + Buffer Dup() const { + Buffer buf = Allocate(len); + std::memcpy(buf.base, base, len); + return buf; + } + void Deallocate() { delete[] base; base = nullptr;