Modified Java example to simplify decompression logic