[erlang-questions] compressed term encoding docs?

Bjorn Gustavsson bjorn@REDACTED
Fri Jun 15 14:59:10 CEST 2007


Thanks for reporting this omission in the documentation.

The missing details will be included in the next release:

2.1. VERSION_MAGIC (131)

The overall format of the term format is:

  1      1       N
+-----+-----+-------------+
| 131 | Tag |   Data      |
+-----+-----+-------------+

A compressed term looks like this:

  1      1          4                  N
+-----+----+-------------------+-----------------------+
| 131 | 80 | Uncompressed Size | Zlib-compressed data  |
+-----+----+-------------------+-----------------------+

Uncompressed Size (usigned 32 bit integer in big endian byte order)
is the size of the data before it was compressed.
The compressed data has the following format when it has been expanded:

   1       N
+-----+-------------+
| Tag |   Data      |
+-----+-------------+

/Bjorn

Daniel Goertzen <daniel.goertzen@REDACTED> writes:

> And the ETF header for a compressed term?  Reverse engineering revealed 
> the type id is 80, but what else is in the header?  (I'm working on 
> c++-erlang bindings btw)
> 
> Thanks,
> Dan.
> 
> Kenneth Lundin wrote:
> > Hi,
> >
> > The bytes as described in erl_ext_dist.txt are compressed with zlib.
> > There is now an option to erlang:term_to_binary/2 where the compression
> > level can be controlled.
> >
> > /Kenneth
> >
> > On 6/14/07, Daniel Goertzen <daniel.goertzen@REDACTED> wrote:
> >> Is the erlang compressed term format documented anywhere?  It does not
> >> appear to be documented in erl_ext_dist.txt which describes all the 
> >> other
> >> term encodings.
> >>
> >>  Thanks,
> >> Dan.
> >>
> >>
> >>
> >> _______________________________________________
> >> erlang-questions mailing list
> >> erlang-questions@REDACTED
> >> http://www.erlang.org/mailman/listinfo/erlang-questions
> >>
> >
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
> 

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list