我有一个Serialized对象存储在" index.dat"文件, 我正在使用以下代码阅读此序列化文件:
try {
FileInputStream fileIn = new FileInputStream("index.dat");
ObjectInputStream in = new ObjectInputStream(fileIn);
Object obj = null;
while( (obj = in.readObject()) != null ){
Word w = (Word) obj;
System.out.println(w.getWord());
System.out.println("_____");
}
in.close();
fileIn.close();
} catch (IOException i) {
} catch (ClassNotFoundException ex) {
}
现在有没有编辑检索到的对象(在这种情况下是obj
)并将其保存在同一位置?