Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void serializeHouse(House house, String filename)
- {
- try(ObjectOutput out = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(filename))))
- {
- out.writeObject(house);
- }
- catch (IOException e)
- {
- System.out.println("Писюн " + e.getMessage());
- }
- }
- public static House deserializeHouse(String filename) throws IOException, ClassNotFoundException, ClassCastException {
- try (ObjectInput in = new ObjectInputStream(new BufferedInputStream(new FileInputStream(filename)))) {
- return (House) in.readObject();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement