用PHP填充Flash CompressionAlgorithm.DEFLATE ByteArray

I'm trying to inflate Flash compressed buffer in PHP.

Here is what I have in Flex ActionScript:

var comp:ByteArray = new ByteArray();
comp.writeObject(buffer);
comp.compress(CompressionAlgorithm.DEFLATE);
var request:URLRequest = new URLRequest(url);
request.method = URLRequestMethod.POST;
request.contentType = contentType;
request.data = comp;
loader.load(request);

The contents of comp will be uploaded to the server in the form of post data. A php script will inflate it:

$contents = gzinflate(file_get_contents($file));

The problem is that this way, the contents of $contents is not identical to buffer. It did inflate, but it always add 4 additional bytes. For instance, 32000 bytes became 32004 bytes. I'm not sure if it's the beginning or the end.

Is there any documentation on what this 4 bytes is about, and how should I inflate this data in php? Thank you.

It turns out that the magic letters are 0C 83 F4 01 . And these 4 bytes are added in the beginning of uncompressed data. I can't find any documentation on this. But by removing these 4 bytes from the beginning of each ByteArray, I can get the original data.