Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void seralizare(Object o, String fis) {
- try {
- FileOutputStream f = new FileOutputStream(fis);
- ObjectOutputStream oos = new ObjectOutputStream(f);
- oos.writeObject(o);
- oos.close();
- f.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- System.out.println("Seralizarea a avut succes");
- }
- static Object deSeralizare(String fis) {
- try {
- FileInputStream f = new FileInputStream(fis);
- ObjectInputStream ois = new ObjectInputStream(f);
- Object o = ois.readObject();
- ois.close();
- f.close();
- return o;
- } catch (IOException | ClassNotFoundException e) {
- e.printStackTrace();
- }
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment