Okay, now did some test to dump the compressed buffer content:
var filename = obj_assets_load.file_name; // a file contains only string "abc" and a new line.
var buf_id_test = buffer_load(filename); // checked the size and content of this buffer, it is 6 byte: 97, 98, 99, 10, 0, 0 (the last two zeros are padded, I think)
var buf_id = buffer_compress(buf_id_test, 0, 4); // so only compress the first 4 bytes, because the original file only contains 4 bytes.
The resulting content of compressed buffer is 23 bytes:
0x78, 0x9c, 0x05, 0xc0, 0x31, 0x11, 0x00, 0x00, 0x00, 0x01, 0xc0, 0x5d, 0x4b, 0xf4, 0xef, 0xf0, 0xd7, 0x3d, 0x00, 0x03, 0x73, 0x01, 0x31
However if I use command "pigz -z -4" to compress the original file containing "abc" and a new line, the result is only 12 bytes:
0x78, 0x9c, 0x4b, 0x4c, 0x4a, 0xe6, 0x02, 0x00, 0x7e, 0x03, 0x01, 0x31
They have the same header, but different content!
Anyone could shed any light on the matter?
Many thanks!