src/main/java/pw/phylame/util/ZLibUtils.java
/**
     * Compresses a specified area of input data with default compression level
     *      and writes to output.
     * @param data the input byte data
     * @param offset start index of compressing area
     * @param length length of compression area
     * @param output the output stream
     */
Compresses a specified area of input data with default compression level
and writes to output.
@param data the input byte data
@param offset start index of compressing area
@param length length of compression area
@param output the output stream
Compresses a specified area of input data with default compression level and writes to output . @param data the input byte data @param offset start index of compressing area @param length length of compression area @param output the output stream
public static void compress(byte[] data, int offset, int length, OutputStream output) {
        DeflaterOutputStream dos = new DeflaterOutputStream(output);
        try {
            dos.write(data, offset, length);
            dos.finish();
            dos.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
public static void compress ( byte [ ] data , int offset , int length , OutputStream output ) { DeflaterOutputStream dos = new DeflaterOutputStream ( output ) ; try { dos . write ( data , offset , length ) ; dos . finish ( ) ; dos . flush ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } }
Compresses a specified area of input data with default compression level
      and writes to output.
Compresses a specified area of input data with default compression level and writes to output .