My program is hanging when it invokes readObject in FileInputStream.
I am not using a socket connection or anything like that, nor am I using an output stream (except for console output).
here is the code:
package com.syd;
import java.util.*;
import java.io.*;
public class PerfectCounter {
private static final String path = "/storage/emulated/0/JavaNIDE/trap13counter/app/src/main/java/com/syd/sequences.data";
public static void main(String[] args) {
new PerfectCounter().run(System.out);
System.out.println("TERMINATED");
}
public void run(PrintStream out){
out.println(System.getProperty("user.dir"));
try(ObjectInputStream in = new ObjectInputStream(new FileInputStream(path))){
out.println("reading...");
HashMap<List<Integer>,Integer> sequences = (HashMap<List<Integer>, Integer>) in.readObject();
out.println("read success");
in.close();
//TODO
}catch(Exception e){
out.printf("err> %s: %s%n", e, e.getMessage());
e.printStackTrace(out);
}
}
}
output:
/
reading...
The file sequences.data is 90MB and I am running this on my android phone (as I do not have a computer).
Searching for answers proved very difficult as only socket connections and the like appeared.
Any help is appreciated. Thanks,