This package provides experimental utilities, made available only for use within Sun, that are useful when reading and writing XML data, converting a stream of Java data to a stream of XML elements (and vice versa).

JavaBeans ObjectInput and ObjectOutput done with XML

The XmlInStream and XmlOutStream classes work together to provide an alternative to serialization; we're currently calling this "publishing" for lack of a better word. Don't think of this as document publishing; it's also distinct from "publish/subscribe" systems. It may be used with both of those kinds of system, but is distinct.

All primitive Java data types may be sent, but not all objects can be sent on these streams. Only JavaBeans can be sent, if they can be initialized using only reflection on public properties. This means that an object's internal state is never exposed, regardless of whether it's marked as transient or not. (That significantly improves the long term versioning story.) Properties which are themselves objects can be sent, permitting graphs (potentially cyclic, but finite) to be sent.

Since the data is in XML format, it is straightforward to interoperate with non-Java programs. The DTD used for this data is the stream.dtd resource in this package. It is fetched locally, rather than accessed over the network.

There's more work to be done in this area. For example, using this to publish Swing objects should leverage a feature that's specific to Swing: a convention for representing "defaulted" values (or at least, ones that are represented as objects) which don't need to be published. And in general, objects may need to participate in their publication, in ways that may call for new APIs.

Base64 support

Not purely related to XML are the two classes for encoding and decoding binary data as Base 64 text. This is a common Internet convention, which maps three bytes of data into four ASCII characters for safe transmission through text-only channels. The classes are used by XmlInStream and XmlOutStream, and are made available for general purpose usage.

Why is this Experimental?

This work is in a usable interim state, but is not final. Some reasons that this is called experimental include: