public static byte[] flateDecode(byte[] input,boolean strict){
  ByteArrayInputStream stream=new ByteArrayInputStream(input);
  InflaterInputStream zip=new InflaterInputStream(stream);
  ByteArrayOutputStream output=new ByteArrayOutputStream();
  byte[] b=new byte[strict ? 4092 : 1];
  try {
    int n;
    while ((n=zip.read(b)) >= 0) {
      output.write(b,0,n);
    }
    zip.close();
    output.close();
    return output.toByteArray();
  }
 catch (  Exception e) {
    return strict ? null : output.toByteArray();
  }
}

public static byte [ ] flateDecode ( byte [ ] input , boolean strict ) { ByteArrayInputStream stream = new ByteArrayInputStream ( input ) ; InflaterInputStream zip = new InflaterInputStream ( stream ) ; ByteArrayOutputStream output = new ByteArrayOutputStream ( ) ; byte [ ] b = new byte [ strict ? 4092 : 1 ] ; try { int n ; while ( ( n = zip . read ( b ) ) >= 0 ) { output . write ( b , 0 , n ) ; } zip . close ( ) ; output . close ( ) ; return output . toByteArray ( ) ; } catch ( Exception e ) { return strict ? null : output . toByteArray ( ) ; } }
a helper to flatedecode .
