TruncatedInputStream.read could violate its contract: if len == 0 yet l > 0, it was returning 0 rather than -1.
This would for example cause IOUtils.copy to hang.