I’m planning to use Serialization to save the Bean modified by user–to store the history record. But the ByteArrayOutputStream output a byte array:byte[]. If I convert it to String and convert it back, then it can’t be de-serialized. –How to explain this?
If I use byte array to store in the oracle, it’s complicated.Is there any way to make the String can be de-serialized? Thank you!
I’m a Chinese, so forgive me for my bad English. 🙂
I’m planning to use Serialization to save the Bean modified by user–to store the
Share
Use
ObjectOutputStreamto serialize andObjectInputStreamto deserialize objects. The API documentation of those classes has examples that show how to use them to serialize and deserialize objects to and from a file.Don’t try to force a
byte[]into aString. (Why would you want to put it in aString?). Serialized objects are binary data, not text characters that you would store in aString.