Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. try
  2. {
  3. fis = new FileInputStream("filename.ser");
  4. ois = new ObjectInputStream(fis);
  5. Object obj = null;
  6.  
  7. try
  8. {
  9. while(true)
  10. obj = ois.readObject();
  11. }
  12. catch(EOFException eof)
  13. {
  14. //end of file reached, do nothing
  15. }
  16. }
  17. finally
  18. {
  19. if (ois != null)
  20. ois.close();
  21.  
  22. if (fis != null)
  23. fis.close();
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement