Package mindustry.io
Class SaveFileReader
java.lang.Object
mindustry.io.SaveFileReader
- Direct Known Subclasses:
SaveVersion
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ReusableByteOutStream
protected final ReusableByteOutStream
protected final ReusableByteOutStream
protected boolean
protected CounterInputStream
protected final DataOutputStream
protected final DataOutputStream
protected final DataOutputStream
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
mapFallback
(String name) abstract void
read
(DataInputStream stream, CounterInputStream counter, WorldContext context) int
readChunk
(DataInput input, boolean isShort, SaveFileReader.IORunner<DataInput> runner) Reads a chunk of some length.int
readChunk
(DataInput input, SaveFileReader.IORunner<DataInput> runner) readStringMap
(DataInput stream) void
region
(String name, DataInput stream, CounterInputStream counter, SaveFileReader.IORunner<DataInput> cons) void
region
(String name, DataOutput stream, SaveFileReader.IORunner<DataOutput> cons) void
void
Skip a chunk completely, discarding the bytes.abstract void
write
(DataOutputStream stream) void
writeChunk
(DataOutput output, boolean isShort, SaveFileReader.IORunner<DataOutput> runner) Write a chunk of input to the stream.void
writeChunk
(DataOutput output, SaveFileReader.IORunner<DataOutput> runner) void
writeStringMap
(DataOutput stream, ObjectMap<String, String> map)
-
Field Details
-
fallback
-
modContentNameMap
-
byteOutput
-
byteOutput2
-
dataBytes
-
dataBytes2
-
byteOutputSmall
-
dataBytesSmall
-
chunkNested
protected boolean chunkNested -
lastRegionLength
protected int lastRegionLength -
currCounter
-
-
Constructor Details
-
SaveFileReader
public SaveFileReader()
-
-
Method Details
-
mapFallback
-
region
public void region(String name, DataInput stream, CounterInputStream counter, SaveFileReader.IORunner<DataInput> cons) throws IOException - Throws:
IOException
-
region
public void region(String name, DataOutput stream, SaveFileReader.IORunner<DataOutput> cons) throws IOException - Throws:
IOException
-
writeChunk
public void writeChunk(DataOutput output, SaveFileReader.IORunner<DataOutput> runner) throws IOException - Throws:
IOException
-
writeChunk
public void writeChunk(DataOutput output, boolean isShort, SaveFileReader.IORunner<DataOutput> runner) throws IOException Write a chunk of input to the stream. An integer of some length is written first, followed by the data.- Throws:
IOException
-
readChunk
- Throws:
IOException
-
readChunk
public int readChunk(DataInput input, boolean isShort, SaveFileReader.IORunner<DataInput> runner) throws IOException Reads a chunk of some length. Use the runner for reading to catch more descriptive errors.- Throws:
IOException
-
skipChunk
- Throws:
IOException
-
skipChunk
Skip a chunk completely, discarding the bytes.- Throws:
IOException
-
writeStringMap
- Throws:
IOException
-
readStringMap
- Throws:
IOException
-
read
public abstract void read(DataInputStream stream, CounterInputStream counter, WorldContext context) throws IOException - Throws:
IOException
-
write
- Throws:
IOException
-