I wrote a pdf parser with my own Deflate decoder. It works fine for all streams contents I encountered up to now, but it fails to decode the binary contents of a xref stream. Here are, in hexadecimal format, the bytes found after "stream" and before "endstream" :
68 DE 62 62 62 60 D8 CB F4 9F 79 F5 1F 20 83 A9 19 48 F0 AB 01 09 86 E9 00 01 06 00 46 3B 04 C4
After dropping the first two bytes (zlib header 0x68 0xDE), my Deflate decoder reads 26 bytes and stops, having produced 34 bytes on output :
02 02 00 00 BD 02 FF 03 AB FC 02 00 00 02 83 02 00 00 02 83 02 FF 26 02 83 O2 0F 26 02 83 02 0F 00 97
Here is the file: https://drive.google.com/open?id=1BHB0AAdAVA6EQuE-aPHrCXvdqU8uUWFP
The /Filter entry in the stream dictionary is set to /FlateDecode and, as far as I can see, this file is not encrypted. There is also a /DecodeParms entry set to a dictionary containing /Columns 4 /Predictor 12, but, if I'm right, it must be used after inflating the stream binary data.
The Deflate decoder produces 34 bytes on output but, even after applying a PNG Up filter, they don't make sense to me.
Thanks.