.datファイルに出力した複数のオブジェクト(自分のクラスTerm)を読み取りたいのですが、常にnullPointExceptionまたは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");
}