30 lines
622 B
Java
30 lines
622 B
Java
package persistance;
|
|
|
|
import java.io.FileInputStream;
|
|
import java.io.FileNotFoundException;
|
|
import java.io.IOException;
|
|
import java.io.ObjectInputStream;
|
|
import java.util.HashMap;
|
|
|
|
import de.hs_mannheim.informatik.bank.domain.Konto;
|
|
|
|
public class Read {
|
|
|
|
public HashMap<Integer,Konto> load() throws ClassNotFoundException
|
|
{
|
|
try {
|
|
ObjectInputStream ois = new ObjectInputStream(new FileInputStream("object.ser"));
|
|
HashMap<Integer, Konto> map = (HashMap<Integer, Konto>) ois.readObject();
|
|
ois.close();
|
|
return map;
|
|
} catch(IOException e )
|
|
{
|
|
return null;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|