private static byte[] Inflate(BinaryReader aReader, long aLength)
{
Stream raw = aReader.BaseStream;
Inflater inflater = new Inflater();
InflaterInputStream stream = new InflaterInputStream(raw, inflater);
long position = raw.Position;
byte[] bytes = new byte[aLength];
stream.Read(bytes, 0, (int)aLength);
raw.Position = position + inflater.TotalIn + 4; // don't know why we add 4 but it works
return (bytes);
}