io/Reader: use std::span

This commit is contained in:
Max Kellermann
2023-10-05 10:25:16 +02:00
parent b9704715fb
commit 7ccc4ddf0d
19 changed files with 52 additions and 51 deletions

View File

@@ -4,10 +4,10 @@
#include "Reader.hxx"
#include "InputStream.hxx"
size_t
InputStreamReader::Read(void *data, size_t size)
std::size_t
InputStreamReader::Read(std::span<std::byte> dest)
{
size_t nbytes = is.LockRead(data, size);
size_t nbytes = is.LockRead(dest.data(), dest.size());
assert(nbytes > 0 || is.IsEOF());
return nbytes;