I want to read multiple objects (my own class Term) that I have output to a .dat file, but I always get a nullPointException or EOFException.
ObjectInputStream inputStream = new ObjectInputStream(new FileInputStream(masterFile));
Object o = null;
while(( o = inputStream.readObject()) != null){
Term t = (Term)o;
System.out.println("I found a term");
}