Frequently Asked Questions

Compatability

Which JDK is required to use XStream?

Currently 1.4 or later. However there are plans to get XStream working on 1.3 in the near future.

Serialization

How do I specify that a field should not be serialized?

Make it transient.

How do I serialize binary data in a byte array?

You need to register a special a Converter:

xstream.registerConverter(new EncodedByteArrayConverter());

This will store binary data in XML by BASE-64 encoding it.

It is not registered by default as the encoding classes are not part of the standard JDK.

Do my classes have to implement Serializable if XStream is to serialize them?

No.

Document History