@@ -0,0 +1,1697 @@
+import java.io.ByteArrayOutputStream;%0Aimport java.util.Arrays;%0Aimport java.util.zip.Deflater;%0Aimport java.util.zip.Inflater;%0A%0A/**%0A * Created by yche on 6/3/17.%0A */%0Apublic class Compression %7B%0A    public static void main(String%5B%5D argv) throws Exception %7B%0A        byte%5B%5D input = %22www.everycoding.com%22.getBytes();%0A%0A        Deflater compressor = new Deflater();%0A        compressor.setLevel(Deflater.BEST_COMPRESSION);%0A        compressor.setInput(input);%0A        compressor.finish();%0A%0A        ByteArrayOutputStream bos = new ByteArrayOutputStream(input.length);%0A%0A        byte%5B%5D buf = new byte%5B1024%5D;%0A        while (!compressor.finished()) %7B%0A            int count = compressor.deflate(buf);%0A            bos.write(buf, 0, count);%0A        %7D%0A        bos.close();%0A        byte%5B%5D compressedData = bos.toByteArray();%0A        System.out.println(%22%E5%8E%8B%E7%BC%A9%E5%90%8E%E7%9A%84byte%E7%BB%93%E6%9E%9C%EF%BC%9A%22 + Arrays.toString(compressedData));%0A        // %E5%AF%B9%E5%8E%8B%E7%BC%A9%E6%95%B0%E6%8D%AE%E8%BF%9B%E8%A1%8C%E8%A7%A3%E5%8E%8B%0A        decompressor(compressedData);%0A    %7D%0A%0A    /**%0A     * %E5%AF%B9%E5%8E%8B%E7%BC%A9%E6%95%B0%E6%8D%AE%E8%BF%9B%E8%A1%8C%E8%A7%A3%E5%8E%8B%0A     *%0A     * @param compressedData%0A     * @throws Exception%0A     */%0A    public static void decompressor(byte%5B%5D compressedData) throws Exception %7B%0A        Inflater decompressor = new Inflater();%0A        decompressor.setInput(compressedData);%0A        ByteArrayOutputStream bos = new ByteArrayOutputStream(compressedData.length);%0A        byte%5B%5D buf = new byte%5B1024%5D;%0A        while (!decompressor.finished()) %7B%0A            int count = decompressor.inflate(buf);%0A            bos.write(buf, 0, count);%0A%0A        %7D%0A        bos.close();%0A        byte%5B%5D decompressedData = bos.toByteArray();%0A        System.out.println(%22%E8%A7%A3%E5%8E%8B%E5%90%8E%E7%9A%84byte%E7%BB%93%E6%9E%9C%EF%BC%9A%22 + Arrays.toString(decompressedData));%0A        System.out.println(%22%E8%A7%A3%E5%8E%8B%E5%87%BA%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%9A%22 + bos.toString());%0A    %7D%0A%7D%0A

add compression study