4jcraft/minecraft/Minecraft.World/ConsoleHelpers/ConsoleSaveFileIO/ConsoleSaveFileOutputStream.h
MatthewBeshay 7ddfaeb59e refactor: remove arrayWithLength, replace with std::vector
Eliminates the custom arrayWithLength<T> wrapper and all typedefs, replacing with std::vector<T> directly.
2026-03-31 12:06:19 +11:00

26 lines
833 B
C++

#pragma once
// 4J Stu - Implements the Java InputStream but rather than writing directly to
// disc it writes through the save file
#include "java/InputOutputStream/OutputStream.h"
#include "ConsoleSavePath.h"
class ConsoleSaveFile;
class FileEntry;
class ConsoleSaveFileOutputStream : public OutputStream {
public:
ConsoleSaveFileOutputStream(ConsoleSaveFile* saveFile,
const ConsoleSavePath& file);
ConsoleSaveFileOutputStream(ConsoleSaveFile* saveFile, FileEntry* file);
virtual void write(unsigned int b);
virtual void write(const std::vector<uint8_t>& b);
virtual void write(const std::vector<uint8_t>& b, unsigned int offset, unsigned int length);
virtual void close();
virtual void flush() {}
private:
ConsoleSaveFile* m_saveFile;
FileEntry* m_file;
};