Fix inconsistence between path reader and writer.

This commit is contained in:
Holt59 2018-03-11 20:34:05 +01:00
parent ca9a00ea97
commit 23b46fd4bc

View File

@ -35,8 +35,7 @@ public class BinaryPathReader extends BinaryReader implements PathReader {
checkVersionOrThrow(dis.readInt()); checkVersionOrThrow(dis.readInt());
// Read map ID and check against graph. // Read map ID and check against graph.
String mapId = readFixedLengthString(BinaryGraphReader.MAP_ID_FIELD_LENGTH, String mapId = readFixedLengthString(BinaryGraphReader.MAP_ID_FIELD_LENGTH, "UTF-8");
"UTF-8");
if (!mapId.equals(graph.getMapId())) { if (!mapId.equals(graph.getMapId())) {
throw new MapMismatchException(mapId, 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. * @throws IndexOutOfBoundsException if the node is not in the graph.
*/ */
protected Node readNode(Graph graph) throws IOException { protected Node readNode(Graph graph) throws IOException {
// Discard zone. return graph.getNodes().get(dis.readInt());
dis.readUnsignedByte();
return graph.getNodes().get(read24bits());
} }
} }