Skip to main content

Binary Encoding Floating Point Data

1 reply [Last post]
wilfred
Offline
Joined: 2003-06-15

All,

I am using the StAX API to serialize a document. Is there any way to make sure that floating point numbers are encoded in a binary way, instead of the default textual encoding?

Thanks,

Wilfred

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sandoz
Offline
Joined: 2003-06-20

The fi/samples [1] contain a number of examples.

For example, the PrimitiveTypesWithElementContentSample example creates an FI document using the SAX API that contains binary values for bytes, ints and floats [2].

See this blog [3] for a command line utility to convert an XML document, given a XML schema, to a typed fast infoset document.

Paul.

[1] http://fisheye5.cenqua.com/browse/fi/samples/src/samples/typed
[2] http://fisheye5.cenqua.com/browse/~raw,r=1.4/fi/samples/src/samples/type...
[3]
http://blogs.sun.com/sandoz/entry/xml_to_typed_fi_utility