Created
June 14, 2018 14:00
-
-
Save conikeec/aafae1354121ca5bc5f10a6a43ef5c57 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
String name; | |
String filename = "file.bin"; | |
try | |
{ | |
FileInputStream file = new FileInputStream(filename); | |
ObjectInputStream out = new ObjectInputStream(file); | |
// Serialization of the "name" (String) object | |
// Will be written to "file.bin" | |
name = (String)out.readObject(); | |
System.out.println(name); | |
out.close(); | |
file.close(); | |
} | |
catch(Exception e) | |
{ | |
System.out.println("Exception: " + e.toString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment