// Create an expandable byte array to hold the inflated data
ByteArrayOutputStream bos = new ByteArrayOutputStream(body.length);
// Inflate the compressed data
byte[] buf = new byte[1024];
while (!inflater.finished()) {
int count = inflater.inflate(buf);
bos.write(buf, 0, count);
}
String result = new String(bos.toByteArray(), "UTF-8");