forked from SteamWar/SteamWar
Changed trace record output to data output/input instead of object output/input
This commit is contained in:
+3
-3
@@ -64,7 +64,7 @@ public class TraceRepository {
|
||||
|
||||
@SneakyThrows
|
||||
protected static void writeTraceRecords(File recordsFile, List<TNTPoint> records) {
|
||||
ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream(recordsFile));
|
||||
DataOutputStream outputStream = new DataOutputStream(new FileOutputStream(recordsFile));
|
||||
for (TNTPoint record : records) {
|
||||
outputStream.writeInt(record.getTntId());
|
||||
outputStream.writeBoolean(record.isExplosion());
|
||||
@@ -88,7 +88,7 @@ public class TraceRepository {
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
protected static TNTPoint readTraceRecord(ObjectInputStream objectInput) {
|
||||
protected static TNTPoint readTraceRecord(DataInputStream objectInput) {
|
||||
|
||||
int tntId = objectInput.readInt();
|
||||
boolean explosion = objectInput.readBoolean();
|
||||
@@ -116,7 +116,7 @@ public class TraceRepository {
|
||||
protected static List<TNTPoint> readTraceRecords(Trace trace) {
|
||||
File recordsFile = trace.getRecordsSaveFile();
|
||||
@Cleanup
|
||||
ObjectInputStream inputStream = new ObjectInputStream(new FileInputStream(recordsFile));
|
||||
DataInputStream inputStream = new DataInputStream(new FileInputStream(recordsFile));
|
||||
|
||||
List<TNTPoint> records = new ArrayList<>();
|
||||
for (int i = 0; i < trace.getRecordsCount(); i++) {
|
||||
|
||||
Reference in New Issue
Block a user