void CheckReader()
{
if (reader == null) {
if (!record.IsCompressed)
throw new InvalidOperationException();
int compressedSize = checked((int)record.Size);
int uncompressedSize = checked((int)compressedReader.ReadUInt32());
byte[] compressedData = new byte[compressedSize];
byte[] uncompressedData = new byte[uncompressedSize];
int compressedRead = compressedReader.Read(compressedData, 0, compressedSize);
Inflater inflater = new Inflater();
inflater.SetInput(compressedData);
int uncompressedRead = inflater.Inflate(uncompressedData, 0, uncompressedSize);
reader = new BinaryReader(new MemoryStream(uncompressedData, false));
endOffset = uncompressedSize;
}
}