--- android/TrainInfo/src/dk/thoerup/traininfo/provider/OfflineStationProvider.java 2011/07/09 07:20:57 1567 +++ android/TrainInfo/src/dk/thoerup/traininfo/provider/OfflineStationProvider.java 2011/07/09 07:26:15 1568 @@ -51,20 +51,20 @@ stations = serializer.read(StationBean.class, new String(data, "ISO-8859-1") );*/ - try { - ObjectInputStream in = new ObjectInputStream( new FileInputStream(stationsFile) ); - Object o; - StationEntry e = null; - while ( (o=in.readObject()) != null ) { - e = (StationEntry) o; - updateSearchStrings(e); - stations.entries.add( e ); - } - in.close(); - } catch (EOFException e) { - //do nothing; + + ObjectInputStream in = new ObjectInputStream( new FileInputStream(stationsFile) ); + + int length = in.readInt(); // first field is the length + + for (int i=0; i