Question

Can anyone recommend a good binary XML format? It's for a JavaME application, so it needs to be a) Easy to implement on the server, and b) Easy to write a low-footprint parser for on a low-end JavaME client device.

And it goes without saying that it needs to be smaller than XML, and faster to parse.


The data would be something akin to SVG.

Was it helpful?

Solution

You might want to take a look at wbxml (Wireless Binary XML) it is optimized for size, and often used on mobile phones, but it is not optimized for parsing speed.

OTHER TIPS

Hessian might be an alternative worth looking at. It is a small protocol, well-suited for Java ME applications.

"Hessian is a binary web service protocol that makes web services usable without requiring a large framework, and without learning a new set of protocols. Because it is a binary protocol, it is well-suited to sending binary data without any need to extend the protocol with attachments."

More links:

Here

Here too

What kind of data are you planning to use? I would say, that if the server is also done in Java, easiest way for small footprint is to send/receive binary data in predefined format. Just write everything in known order into DataOutputStream.

But it would really depend, what what kind of data are you working on and can you define the format.

Actually you should evaluate, if this kind of optimization is even needed. Maybe you target devices are not so limited.

It very much depends on the target device. If you have JSR172 available, then you are done with the parsing, the runtime does it for you. And XML is mainly about making your own format. As was alredy stated if your goal is performance, than XML is probably not the best way to go and you will end up doing some binary stuff.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top