mpd/src/io/Reader.cxx
2023-10-07 08:45:52 +02:00

15 lines
307 B
C++

// SPDX-License-Identifier: BSD-2-Clause
// author: Max Kellermann <max.kellermann@gmail.com>
#include "Reader.hxx"
#include <stdexcept>
void
Reader::ReadFull(std::span<std::byte> dest)
{
const auto nbytes = Read(dest);
if (nbytes < dest.size())
throw std::runtime_error{"Unexpected end of file"};
}