Browse Source

Close stream when reading/writing is done.

Holt59 3 years ago
parent
commit
94cbeef58f

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

@@ -54,6 +54,8 @@ public class BinaryPathReader extends BinaryReader implements PathReader {
54 54
             nodes.add(readNode(graph));
55 55
         }
56 56
 
57
+        this.dis.close();
58
+
57 59
         return Path.createFastestPathFromNodes(graph, nodes);
58 60
     }
59 61
 

+ 1
- 0
src/main/org/insa/graph/io/BinaryPathWriter.java View File

@@ -48,6 +48,7 @@ public class BinaryPathWriter extends BinaryWriter implements PathWriter {
48 48
         }
49 49
 
50 50
         dos.flush();
51
+        dos.close();
51 52
     }
52 53
 
53 54
 }

Loading…
Cancel
Save