From breischl: handle compression streams explicitly
Change exceptions to inherit from ApplicationException
Update code documentation