Use buffered input/output streams
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user