diff --git a/src/core/serialisation.hpp b/src/core/serialisation.hpp index 9f33e66394..6a53744b7b 100644 --- a/src/core/serialisation.hpp +++ b/src/core/serialisation.hpp @@ -78,9 +78,9 @@ struct BufferSerialisationHelper { BufferSend_binary(self->GetSerialisationBuffer(), self->GetSerialisationLimit(), data, size); } - void Send_binary(const byte *data, const byte *end) + void Send_binary(std::span data) { - this->Send_binary(data, end - data); + this->Send_binary(data.data(), data.size()); } void Send_buffer(const byte *data, const size_t size) @@ -263,6 +263,15 @@ public: pos += (decltype(pos)) size; } + /** + * Reads binary data. + * @param buffer The buffer to put the data into. + */ + void Recv_binary(std::span buffer) + { + this->Recv_binary(buffer.data(), buffer.size()); + } + /** * Returns view of binary data. * @param size The size of the data.