term_to_binary from jinterface (?)

Jimmy Olgeni olgeni@REDACTED
Fri Jul 18 17:14:44 CEST 2003


Hi,

Quick encoding question :)

I'm trying to implement "term_to_binary" in a Java client, using
something like:

  OtpOutputStream otpOutputStream = new OtpOutputStream (whateverTerm);

and then sending the byte array from "otpOutputStream.toByteArray()"
over a connected TCP socket.

The server part (erlang) uses binary_to_term to parse the data packet, but
consistently fails because the byte array from "toByteArray" lacks the
versionTag at byte 0 (that is, 131).

I see that the versionTag is managed when receiving messages, but
is not inserted when encoding: am I supposed to provide my own
versionTag in encoded packets?

-- 
jimmy



More information about the erlang-questions mailing list