void CheckEnd()
{
if (IsFinished)
return;
if (!IsInputFinished) {
if (!IsOutputFinished)
throw new InvalidDataException("Neither the input nor the output finished decompressing.");
throw new InvalidDataException("The input did not finish decompressing.");
} else if (!IsOutputFinished)
throw new InvalidDataException("The output did not finish decompressing.");
}