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