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

Michael McDaniel erlangy@REDACTED
Wed May 7 00:41:55 CEST 2008


 a web search with these terms ..

 erlang jinterface byte 131

 
 reveals this thread ...

 http://www.erlang.org/pipermail/erlang-questions/2005-June/015760.html


"...

 > Yes, the 131 (*) is always there, because term_to_binary encodes  
 > into Erlang external format.
 >
 > See also $ERL_TOP/erts/emulator/internal_doc/erl_ext_dist.txt for  
 > details about the format, if you're interested.

..."


~Michael


On Tue, May 06, 2008 at 02:31:14PM -0700, Jonathan Gray wrote:
> 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
> 131).
> 
> 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
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

-- 
Michael McDaniel
Portland, Oregon, USA
http://autosys.us
+1 503 283 5284



More information about the erlang-questions mailing list