Use buffered input/output streams

This commit is contained in:
2022-02-19 22:04:41 -06:00
parent 13fb7168bf
commit 0026d8cdfe
3 changed files with 5 additions and 7 deletions

View File

@@ -1,7 +1,4 @@
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.*;
public class GraphDataObjectReader {
private GraphWithMapData data;
@@ -13,7 +10,7 @@ public class GraphDataObjectReader {
}
this.filename = filename;
try(//don't need to close these because of try-with-resources
FileInputStream fileIn = new FileInputStream(filename);
BufferedInputStream fileIn = new BufferedInputStream(new FileInputStream(filename));
ObjectInputStream in = new ObjectInputStream(fileIn))
{
data = (GraphWithMapData) in.readObject();