Here you can find the source of deflate(byte[] paramArrayOfByte)
public static byte[] deflate(byte[] paramArrayOfByte)
//package com.java2s; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.Deflater; import java.util.zip.DeflaterOutputStream; public class Main { public static byte[] deflate(byte[] paramArrayOfByte) { return deflate(paramArrayOfByte, 0, paramArrayOfByte.length); }//from w ww. j av a 2 s . c o m public static byte[] deflate(byte[] paramArrayOfByte, int paramInt1, int paramInt2) { ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream(); DeflaterOutputStream localDeflaterOutputStream = new DeflaterOutputStream( localByteArrayOutputStream, new Deflater()); try { localDeflaterOutputStream.write(paramArrayOfByte, paramInt1, paramInt2); localDeflaterOutputStream.close(); return localByteArrayOutputStream.toByteArray(); } catch (IOException localIOException) { throw new IllegalStateException("ByteArrayOutputStream threw ", localIOException); } } }