aboutsummaryrefslogtreecommitdiff
path: root/core/src/Utils/IO/Archive.cpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2021-11-10 20:44:52 -0800
committerrtk0c <[email protected]>2021-11-10 20:44:52 -0800
commit816bbe7993adf4a41ace7bae06bfe6a5921308b8 (patch)
treeb10decb90b27b11a66a6089f2ebcf5b62aa8b643 /core/src/Utils/IO/Archive.cpp
parent04653742243e4bb6452108cfd0fef2f4afd8f23b (diff)
Switch more IO to use DataArchive
Diffstat (limited to 'core/src/Utils/IO/Archive.cpp')
-rw-r--r--core/src/Utils/IO/Archive.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/src/Utils/IO/Archive.cpp b/core/src/Utils/IO/Archive.cpp
index aa47b67..f6e7b27 100644
--- a/core/src/Utils/IO/Archive.cpp
+++ b/core/src/Utils/IO/Archive.cpp
@@ -17,7 +17,9 @@ std::span<const uint8_t, 8> DataArchive::GetMagicNumbers()
std::optional<InputDataStream> DataArchive::LoadFile(const std::filesystem::path& path)
{
- auto stream = InputDataStream(InputFileStream(path));
+ InputFileStream fileStream(path);
+ fileStream.SetReadInSize(1024);
+ InputDataStream stream(std::move(fileStream));
uint8_t magicNumbers[kMagicNumberCount];
stream.ReadBytes(kMagicNumberCount, magicNumbers);
@@ -42,7 +44,9 @@ std::optional<InputDataStream> DataArchive::LoadFile(const std::filesystem::path
std::optional<OutputDataStream> DataArchive::SaveFile(const std::filesystem::path& path)
{
- auto stream = OutputDataStream(OutputFileStream(path, OutputFileStream::TruncateFile));
+ OutputFileStream fileStream(path, OutputFileStream::TruncateFile);
+ fileStream.SetMaxBufferSize(1024);
+ OutputDataStream stream(std::move(fileStream));
stream.WriteBytes(kMagicNumberCount, kMagicNumbers);
stream.Write(kByteOrderMark);