refactor io

This commit is contained in:
2025-02-26 10:14:06 +01:00
parent b77c650fdf
commit 605a310ede
9 changed files with 190 additions and 140 deletions

16
src/sp/io/Memory.cpp Normal file
View File

@@ -0,0 +1,16 @@
#include <sp/io/Memory.h>
namespace sp {
namespace io {
sp::DataBuffer Memory::Read(std::size_t a_Amount) {
DataBuffer data;
m_VirtualIO.ReadSome(data, a_Amount > m_VirtualIO.GetRemaining() ? m_VirtualIO.GetRemaining() : a_Amount);
return data;
}
void Memory::Write(const sp::DataBuffer& a_Data) {
m_VirtualIO << a_Data;
}
} // namespace io
} // namespace sp