Here you can find the source of deflate(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
public static byte[] deflate(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
//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); }/* w ww . ja va2 s.co 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); } } }