aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ConsoleSaveFileInputStream.h
blob: 876a9484b10671877583ed1aeb6be544027d55c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once
// 4J Stu - Implements the Java InputStream but rather than writing directly to disc it writes through the save file

#include "InputStream.h"

#include "ConsoleSavePath.h"

class ConsoleSaveFile;
class FileEntry;

class ConsoleSaveFileInputStream : public InputStream
{
public:
	ConsoleSaveFileInputStream(ConsoleSaveFile *saveFile, const ConsoleSavePath &file);
	ConsoleSaveFileInputStream(ConsoleSaveFile *saveFile, FileEntry *file);
	virtual int read();
	virtual int read(byteArray b);
	virtual int read(byteArray b, unsigned int offset, unsigned int length);
	virtual void close();
	virtual __int64 skip(__int64 n) { return n; }

private:
	ConsoleSaveFile *m_saveFile;
	FileEntry *m_file;

};