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
|
@SneakyThrows
|
||||||
protected static void writeTraceRecords(File recordsFile, List<TNTPoint> records) {
|
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) {
|
for (TNTPoint record : records) {
|
||||||
outputStream.writeInt(record.getTntId());
|
outputStream.writeInt(record.getTntId());
|
||||||
outputStream.writeBoolean(record.isExplosion());
|
outputStream.writeBoolean(record.isExplosion());
|
||||||
@@ -88,7 +88,7 @@ public class TraceRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
protected static TNTPoint readTraceRecord(ObjectInputStream objectInput) {
|
protected static TNTPoint readTraceRecord(DataInputStream objectInput) {
|
||||||
|
|
||||||
int tntId = objectInput.readInt();
|
int tntId = objectInput.readInt();
|
||||||
boolean explosion = objectInput.readBoolean();
|
boolean explosion = objectInput.readBoolean();
|
||||||
@@ -116,7 +116,7 @@ public class TraceRepository {
|
|||||||
protected static List<TNTPoint> readTraceRecords(Trace trace) {
|
protected static List<TNTPoint> readTraceRecords(Trace trace) {
|
||||||
File recordsFile = trace.getRecordsSaveFile();
|
File recordsFile = trace.getRecordsSaveFile();
|
||||||
@Cleanup
|
@Cleanup
|
||||||
ObjectInputStream inputStream = new ObjectInputStream(new FileInputStream(recordsFile));
|
DataInputStream inputStream = new DataInputStream(new FileInputStream(recordsFile));
|
||||||
|
|
||||||
List<TNTPoint> records = new ArrayList<>();
|
List<TNTPoint> records = new ArrayList<>();
|
||||||
for (int i = 0; i < trace.getRecordsCount(); i++) {
|
for (int i = 0; i < trace.getRecordsCount(); i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user