Read from compressed stream.
Update some of the details - maths was wrong.