28 Mar 2012 03:19
The right data for Embedded XZ?
Hi,
I am trying to use Embedded XZ in a project. Is there something special I
should know about how to compress data so that it is suitable for decoding
by Embedded XZ? Is it supposed to work with any valid .xz file? Or is it
supposed to use raw .xz files?
Here is what I have done: Compress a file as:
xz file
So I have file.xz. I wrote a C program to load that entire file into an
array, call xz_dec_init() and then xz_dec_run(), with all the right xz_buf
parameters filled in. xz_dec_run() always returns XZ_DATA_ERROR, which
xz.h defines as meaning the data is corrupt. I figured that perhaps I'm
not supposed to include the 6-byte magic header (FD 37 7A 58 5A 00) so I
defined xz_buf.in_pos to skip those bytes. This changes the returned error
to XZ_FORMAT_ERROR.
How should I compress the data so that Embedded XZ likes it? Or have I got
the wrong problem?
Thanks,
--
-Mike Melanson
RSS Feed