Browse Source

Fix inconsistence between path reader and writer.

Holt59 6 years ago
parent
commit
23b46fd4bc
1 changed files with 2 additions and 6 deletions
  1. 2
    6
      src/main/org/insa/graph/io/BinaryPathReader.java

+ 2
- 6
src/main/org/insa/graph/io/BinaryPathReader.java View File

@@ -35,8 +35,7 @@ public class BinaryPathReader extends BinaryReader implements PathReader {
35 35
         checkVersionOrThrow(dis.readInt());
36 36
 
37 37
         // Read map ID and check against graph.
38
-        String mapId = readFixedLengthString(BinaryGraphReader.MAP_ID_FIELD_LENGTH,
39
-                "UTF-8");
38
+        String mapId = readFixedLengthString(BinaryGraphReader.MAP_ID_FIELD_LENGTH, "UTF-8");
40 39
 
41 40
         if (!mapId.equals(graph.getMapId())) {
42 41
             throw new MapMismatchException(mapId, graph.getMapId());
@@ -69,10 +68,7 @@ public class BinaryPathReader extends BinaryReader implements PathReader {
69 68
      * @throws IndexOutOfBoundsException if the node is not in the graph.
70 69
      */
71 70
     protected Node readNode(Graph graph) throws IOException {
72
-        // Discard zone.
73
-        dis.readUnsignedByte();
74
-
75
-        return graph.getNodes().get(read24bits());
71
+        return graph.getNodes().get(dis.readInt());
76 72
     }
77 73
 
78 74
 }

Loading…
Cancel
Save