用gzip压缩字节数组
//nowjava - 时 代 Java //package com.nowjava; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.GZIPOutputStream; public class Main { /** * Compresses a byte array */ public static byte[] compress(byte[] theBytes) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); GZIPOutputStream gos = new GZIPOutputStream(bos); gos.