Package mindustry.io
Class SaveFileReader
java.lang.Object
mindustry.io.SaveFileReader
- Direct Known Subclasses:
SaveVersion
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final arc.util.io.ReusableByteOutStreamprotected static final arc.util.io.ReusableByteOutStreamprotected static booleanprotected static final arc.util.io.Readsprotected static final DataOutputStreamprotected static final DataOutputStreamprotected static final arc.util.io.Writesprotected static final arc.util.io.Writes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringmapFallback(String name) abstract voidread(DataInputStream stream, arc.util.io.CounterInputStream counter, WorldContext context) intreadChunk(DataInput input, SaveFileReader.IORunnerLength<DataInput> runner) Reads a chunk of some length.intreadChunkReads(DataInput input, SaveFileReader.IORunnerLength<arc.util.io.Reads> runner) Reads a chunk of some length.intreadLegacyShortChunk(DataInput input, SaveFileReader.IORunnerLength<arc.util.io.Reads> runner) Reads a legacy chunk where the length is only 2 bytes.voidreadRegion(String name, DataInput stream, arc.util.io.CounterInputStream counter, SaveFileReader.IORunner<DataInput> cons) arc.struct.StringMapreadStringMap(DataInput stream) voidSkip a chunk completely, discarding the bytes.voidskipLegacyShortChunk(DataInput input) Skip a legacy chunk completely, discarding the bytes.abstract voidwrite(DataOutputStream stream) voidwriteChunk(DataOutput output, SaveFileReader.IORunner<arc.util.io.Writes> runner) Write a chunk of input to the stream.voidwriteRegion(String name, DataOutput stream, SaveFileReader.IORunner<DataOutput> cons) voidwriteStringMap(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
-