FileOutputStream fileOutputStream = new FileOutputStream(OBJECT_DATA);ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);objectOutputStream.writeObject(serializableObject);FileInputStream fileInputStream = new FileInputStream(OBJECT_DATA);ObjectInputStream objectInputStream = new ObjectInputStream (fileInputStream);Serializable imageFromDisk = (Serializable) objectInputStream.readObject();
Ad
Tuesday, September 21, 2010
Java object serialization
Here is a quick tutorial on how to quickly serialize (write to desk) and unserialize (read from disk) a java object that implements the java.io.Serializable interface:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment