final byte[] uncompressed = entityText.getBytes(Consts.UTF_8);
final Deflater compressor = new Deflater(Deflater.DEFAULT_COMPRESSION, rfc1951);
compressor.setInput(uncompressed);
compressor.finish();
final byte[] output = new byte[100];
final int compressedLength = compressor.deflate(output);
final byte[] compressed = new byte[compressedLength];
System.arraycopy(output, 0, compressed, 0, compressedLength);
response.setEntity(new InputStreamEntity(
new ByteArrayInputStream(compressed), compressedLength));
return;