<div dir="ltr">Just RTM<br><a href="http://www.erlang.org/doc/apps/erts/erl_ext_dist.html#8">http://www.erlang.org/doc/apps/erts/erl_ext_dist.html#8</a><br><br><div class="gmail_quote">On Mon, Oct 6, 2008 at 3:29 AM, deepblue_other <span dir="ltr"><<a href="mailto:cktgatb@gmail.com">cktgatb@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
for example<br>
one day I was looking at the term_to_binary() output of<br>
{binaries,"are",useful}<br>
and it was:<br>
131,104,3,100,0,8,98,105,110,97,114,105,101,115,107,0,3,97,114,101,100,0,6,117,115,101,102,117,108<br>
<br>
so with a little experimentation with other tuples I got these rules so far:<br>
131,104 - this means that its a tuple<br>
3 - this means that it has 3 terms<br>
100 and 107 - type code - in this case 100 stands for atoms, and 107 stands<br>
for strings<br>
0 - is the separator between the "type code"(name I gave it<br>
just now ;) ) and the actual ASCII sequence<br>
8 and 3(again) and 6 - these indicate the length of the binary sequence<br>
(number of ASCII characters in this case<br>
<br>
so:<br>
binaries - 100(type code),0,8(byte length),98,105,110,97,114,105,101,115<br>
"are" - 107(type code),0,3(byte length),97,114,101<br>
useful - 100(type code),0,6(byte length),117,115,101,102,117,108<br>
<br>
this just explains a limited set, doesnt go into lists...<br>
I could be wrong, but the rules seem to match up other examples as well<br>
<br>
thanks<br>
<br>
deepblue_other wrote:<br>
><br>
> term_to_binary() outputs a binary.<br>
> what is the format of that binary? I would like to create a<br>
> "unpacker/packer" for that format in ActionScript3, and avoid the use of<br>
> XML (which Im using now for Flash-to-Erlang) communication altogether. it<br>
> would be faster, less code, and much more efficient from the bandwidth<br>
> point of view.<br>
><br>
> is there a document someplace that gives the byte layout maybe?<br>
> thank you<br>
><br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://www.nabble.com/Erlang-external-binary-term-format-tp19830781p19830881.html" target="_blank">http://www.nabble.com/Erlang-external-binary-term-format-tp19830781p19830881.html</a><br>
Sent from the Erlang Questions mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>--Hynek (Pichi) Vychodil<br>
</div>