Salve ragazzi ho un problema.. perche il metodo readObject di ObjectInputStream si blocca?
cioe quando legge il file sorgente che e un file .dat non legge tutte le righe all'interno del file fisico (sull'hard disk) ma sempre la prima riga perche? Allego anche un immaggien per capire meglio
codice:
public class Apertura extends WindowAdapter implements Serializable {
static final long serialVersionUID = -6849794470754667710L;
public void windowOpened(WindowEvent e) {
try(ObjectInputStream in = new ObjectInputStrea (newFileInputStream ("c:/ore.dat"))) {
indice = (String) in.readObject();
model.addElement(indice ); //DefaultListModel
} catch (IOException w) {
w.printStackTrace();
} catch (ClassNotFoundException w) {
w.printStackTrace();
} catch (ClassCastException w) {
w.printStackTrace();
}
}
}