From 23b46fd4bc960f5583787f5f0cbcca2b20988d22 Mon Sep 17 00:00:00 2001 From: Holt59 Date: Sun, 11 Mar 2018 20:34:05 +0100 Subject: [PATCH] Fix inconsistence between path reader and writer. --- src/main/org/insa/graph/io/BinaryPathReader.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/org/insa/graph/io/BinaryPathReader.java b/src/main/org/insa/graph/io/BinaryPathReader.java index 961f5f8..71c66f0 100644 --- a/src/main/org/insa/graph/io/BinaryPathReader.java +++ b/src/main/org/insa/graph/io/BinaryPathReader.java @@ -35,8 +35,7 @@ public class BinaryPathReader extends BinaryReader implements PathReader { checkVersionOrThrow(dis.readInt()); // Read map ID and check against graph. - String mapId = readFixedLengthString(BinaryGraphReader.MAP_ID_FIELD_LENGTH, - "UTF-8"); + String mapId = readFixedLengthString(BinaryGraphReader.MAP_ID_FIELD_LENGTH, "UTF-8"); if (!mapId.equals(graph.getMapId())) { throw new MapMismatchException(mapId, graph.getMapId()); @@ -69,10 +68,7 @@ public class BinaryPathReader extends BinaryReader implements PathReader { * @throws IndexOutOfBoundsException if the node is not in the graph. */ protected Node readNode(Graph graph) throws IOException { - // Discard zone. - dis.readUnsignedByte(); - - return graph.getNodes().get(read24bits()); + return graph.getNodes().get(dis.readInt()); } }