port fix for COMPRESS-289 from Commons Compress