[erlang-questions] how: Strange issue with Jinterface and marshalling

Jonathan Gray <>
Tue May 6 23:31:14 CEST 2008

I am having a very strange problem when marshalling an Erlang term in Java
using Jinterface and sending it to a native erlang program.

I am able to unmarshall from Erlang to Java, and marshall and unmarshall
within Java.

After spending some time looking into the raw data, it appears that when I
marshall the same term within Erlang there is an extra byte at the front
that is missing from the Java marshalled bytes.  It is a hex 0x83 (integer

If I append this to the front of my byte array in Java, and then send, my
erlang program can demarshall it without any problem whatsoever.  The
Jinterface library is able to demarshall either format (w/ and w/o the
header) into the exact same erlang terms.

Is this some type of version header?  I'm using the Jinterface library
that came with the erlang version I am using.

We have moved forward by simply appending this extra byte, but this is a
very strange behavior and we'd like to figure out what it's all about.

Thanks for any help.

Jonathan Gray

More information about the erlang-questions mailing list