XStream 0.2 released

See this.

  • Trackback are closed
  • Comments (9)
    • Christopher R. Gardner
    • December 1st, 2003

    I worked on a project for which we chose to use JAXB, which can validate an XML document for compliance with an XML schema before creating a Java rendering of it.

    Can XStream validate an XML document against a schema?

  1. I couldn’t resist this opportunity to give xstream a spin :)

    And as far as XML encoder goes, it performs very nicely indeed.

    The resulting XML is very nice and around 5 time smaller than the one produced by JSX (and somewhat smaller than what java.beans.XMLEncoder creates).

    As far as speed goes, xstream is somewhat faster than JSX and XMLDecoder for write operations. But it seems to be somewhat slower for reads (?).

    Using the default Java serialization mechanism as implemented by ObjectOutputStream/ObjectInputStream as a benchmark, xstream is about 4 time more verbose than Java serialization format. Ditto for speed: Java serialization is about 4 time faster for write and around 20 time faster for read (???). Of course, YMMV.

    (I’m not quiet sure why xstream seems to struggle so much with read operations though)

    While xstream is very nice as it is, is would be even nicer if it could be used as a drop-in replacement for ObjectStream… :)

    • pritam
    • December 15th, 2003

    Does XStream has dependency on J2SDK1.4 and not backword compatible.I was getting ClassDefNotFound sun.reflect.ReflectionFactory with jdk1.3.1 but when run with j2sdk1.4 it works fine.Can u suggest.

    • Ben Smith
    • December 16th, 2003

    Pritam – create your own objectfactory and pass it in.

    Joe – I have made a few changes to the code. I Submitted them on jira:

    1. It allows circular references by using a unique integer id for each. This is ONLY changed in objectwithfieldsconverter.

    2. I changed the null fields to look like:

    3. I haven’t done the reading part – you will know more about it.

    I do not know how to write this code in a single place when you have so many converters. Maybe you should look at using a pico-type inversion of control mechanism ? Pico is overkill for the problem, but ioc3 isnt if I understand it correctly.

    Great project!

    • Ben Smith
    • December 16th, 2003

    The xml didnt come out on number 2. Check on jira.

    • Chung Zao
    • December 17th, 2003

    This great project. Please complete circular reference!

    • Gregor Putin
    • December 18th, 2003

    It looks like someone has finally come up with the missing link! Java has needed a tool like this for a long time (liberally open source licensed instead of proprietary).

    Keep up the good work.


    • Jens
    • January 6th, 2004

    I can confirm the results which Zoe provided. Compared to JSX, I (in general) find the design of XStream more clean – but I would very much like to see some improvements regarding speed over time. Thanks for a great alternative to JSX and even better it’s open source ;-) Keep up the brilliant work.


    • Testing XStream
    • January 10th, 2004

    The [ultimate] test for xstream :

    XStream stream = new XStream();
    String data = stream.toXML(new JTable());

    // will throw outofmemoryexception here!

Comments are closed.
%d bloggers like this: