Created
November 8, 2014 06:10
-
-
Save RammusXu/ad1c3a16a4c5a9fd9b69 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void writeObject(File file, Object object) { | |
try { | |
FileOutputStream fos = new FileOutputStream(file); | |
ObjectOutputStream oos = new ObjectOutputStream(fos); | |
oos.writeObject(object); | |
oos.close(); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
} | |
private Object readObject(File file) { | |
Object returnlist = null; | |
try { | |
FileInputStream fis = new FileInputStream(file); | |
ObjectInputStream ois = new ObjectInputStream(fis); | |
returnlist = ois.readObject(); | |
ois.close(); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
return returnlist; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment