5

I have a complex set of data models that currently implement java.io.Serializable, and I have successfully serialized and deserialized them with ObjectOutputStream and ObjectInputStream.

However, the result are binary files (as expected), and I was wondering if Java supports serialization and deserialization in the same manner to a non-binary format, such as XML.


I see that C# has this feature: XML vs Binary performance for Serialization/Deserialization.

Performance speed/ efficiency is not a consideration in this case.

2 Answers 2

5

Further, I would suggest you to look at Simple and XStream frameworks. I found both good. You can choose to go with either one, or may be XmlEncoder as suggested by Jack.

Sign up to request clarification or add additional context in comments.

2 Comments

I'm chiming in for XStream too.
Simple if far more performant that XStream, at worst case its 2x faster. Also, for very large object graphs Simple beats Java object serialization.
4

Yes, Java has it and it's called XML Encoding. Check it out here!

The approach is quite similar to the normal serialization..

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.