src/main/java/pw/phylame/util/ZLibUtils.java
/**
     * Decompresses byte data from specified input stream.
     * @param input the input stream
     * @return decompressed data
     */
Decompresses byte data from specified input stream.
@param input the input stream
@return decompressed data
Decompresses byte data from specified input stream . @param input the input stream @return decompressed data
public static byte[] decompress(InputStream input) {
        InflaterInputStream iis = new InflaterInputStream(input);
        ByteArrayOutputStream o = new ByteArrayOutputStream(BUFFER_SIZE);
        try {
            int i = BUFFER_SIZE;
            byte[] buf = new byte[i];
            while ((i = iis.read(buf, 0, i)) > 0) {
                o.write(buf, 0, i);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return o.toByteArray();
    }
public static byte [ ] decompress ( InputStream input ) { InflaterInputStream iis = new InflaterInputStream ( input ) ; ByteArrayOutputStream o = new ByteArrayOutputStream ( BUFFER_SIZE ) ; try { int i = BUFFER_SIZE ; byte [ ] buf = new byte [ i ] ; while ( ( i = iis . read ( buf , 0 , i ) ) > 0 ) { o . write ( buf , 0 , i ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } return o . toByteArray ( ) ; }
Decompresses byte data from specified input stream.
Decompresses byte data from specified input stream .