XMLEncoder does not encode zero values

355 Views Asked by At

I'm encoding a short integer with value 0 and XMLEncoder does not encode it.

How can I force it?

2

There are 2 best solutions below

1
On BEST ANSWER

I switched to another library: XStream (http://x-stream.github.io/)

Much simpler and it works.

2
On

XMLEncoder does not encode default values. It saves space. It works.