Package mindustry.io
Class SaveFileReader
java.lang.Object
mindustry.io.SaveFileReader
- Direct Known Subclasses:
SaveVersion
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final arc.util.io.ReusableByteOutStream
protected static final arc.util.io.ReusableByteOutStream
protected static boolean
protected static final arc.util.io.Reads
protected static final DataOutputStream
protected static final DataOutputStream
protected static final arc.util.io.Writes
protected static final arc.util.io.Writes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
mapFallback
(String name) abstract void
read
(DataInputStream stream, arc.util.io.CounterInputStream counter, WorldContext context) int
readChunk
(DataInput input, SaveFileReader.IORunnerLength<DataInput> runner) Reads a chunk of some length.int
readChunkReads
(DataInput input, SaveFileReader.IORunnerLength<arc.util.io.Reads> runner) Reads a chunk of some length.int
readLegacyShortChunk
(DataInput input, SaveFileReader.IORunnerLength<arc.util.io.Reads> runner) Reads a legacy chunk where the length is only 2 bytes.void
readRegion
(String name, DataInput stream, arc.util.io.CounterInputStream counter, SaveFileReader.IORunner<DataInput> cons) arc.struct.StringMap
readStringMap
(DataInput stream) void
Skip a chunk completely, discarding the bytes.void
skipLegacyShortChunk
(DataInput input) Skip a legacy chunk completely, discarding the bytes.abstract void
write
(DataOutputStream stream) void
writeChunk
(DataOutput output, SaveFileReader.IORunner<arc.util.io.Writes> runner) Write a chunk of input to the stream.void
writeRegion
(String name, DataOutput stream, SaveFileReader.IORunner<DataOutput> cons) void
writeStringMap
(DataOutput stream, arc.struct.ObjectMap<String, String> map)
-
Field Details
-
fallback
-
modContentNameMap
-
byteOutput
protected static final arc.util.io.ReusableByteOutStream byteOutput -
byteOutput2
protected static final arc.util.io.ReusableByteOutStream byteOutput2 -
dataBytes
-
dataBytes2
-
writes1
protected static final arc.util.io.Writes writes1 -
writes2
protected static final arc.util.io.Writes writes2 -
chunkReads
protected static final arc.util.io.Reads chunkReads -
chunkNested
protected static boolean chunkNested
-
-
Constructor Details
-
SaveFileReader
public SaveFileReader()
-
-
Method Details
-
mapFallback
-
readRegion
public void readRegion(String name, DataInput stream, arc.util.io.CounterInputStream counter, SaveFileReader.IORunner<DataInput> cons) throws IOException - Throws:
IOException
-
writeRegion
public void writeRegion(String name, DataOutput stream, SaveFileReader.IORunner<DataOutput> cons) throws IOException - Throws:
IOException
-
writeChunk
public void writeChunk(DataOutput output, SaveFileReader.IORunner<arc.util.io.Writes> 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
public int readChunk(DataInput input, SaveFileReader.IORunnerLength<DataInput> runner) throws IOException Reads a chunk of some length. Use the runner for reading to catch more descriptive errors.- Throws:
IOException
-
readChunkReads
public int readChunkReads(DataInput input, SaveFileReader.IORunnerLength<arc.util.io.Reads> runner) throws IOException Reads a chunk of some length. Use the runner for reading to catch more descriptive errors.- Throws:
IOException
-
skipChunk
Skip a chunk completely, discarding the bytes.- Throws:
IOException
-
readLegacyShortChunk
public int readLegacyShortChunk(DataInput input, SaveFileReader.IORunnerLength<arc.util.io.Reads> runner) throws IOException Reads a legacy chunk where the length is only 2 bytes.- Throws:
IOException
-
skipLegacyShortChunk
Skip a legacy chunk completely, discarding the bytes.- Throws:
IOException
-
writeStringMap
public void writeStringMap(DataOutput stream, arc.struct.ObjectMap<String, String> map) throws IOException- Throws:
IOException
-
readStringMap
- Throws:
IOException
-
read
public abstract void read(DataInputStream stream, arc.util.io.CounterInputStream counter, WorldContext context) throws IOException - Throws:
IOException
-
write
- Throws:
IOException
-