[erlang-questions] zlib compress and uncompress on bit string << 255, 3:2 >>.
Kostis Sagonas
kostis@REDACTED
Thu Oct 28 02:54:01 CEST 2010
rgowka1 wrote:
> Hi -
>
> I am using zlib:compress and uncompress on bitstring.
>
> The expression zlib:uncompress( zlib:compress ( << 255, 3:2 >> )) =:=
> << 255, 3:2 >> is evaluating to false.
>
> zlib:uncompress( zlib:compress ( << 255, 3:2 >> )).
> <<"ÿ">>
>
> << << X >> || << X:1 >> <= <<"ÿ">> >>.
> <<1,1,0,0,0,0,1,1,1,0,1,1,1,1,1,1>>
>
> << << X >> || << X:1 >> <= << 255, 3:2 >> >>.
> <<1,1,1,1,1,1,1,1,1,1>>
>
> Is this a bug with the zlib library or am I missing something basic here?
What exactly makes you consider it a bug?
The manual clearly mentions that zlib:uncompress/1 returns a binary().
Why do you expect that equality of this term with a bitstring() which is
not a binary() should succeed?
Kostis
More information about the erlang-questions
mailing list