文件流压缩

byte[] outByte = out.toByteArray();

ByteArrayOutputStream zipOut =new ByteArrayOutputStream();

ZipOutputStream zipOutputStream =new ZipOutputStream(zipOut);

ZipEntry entry =new ZipEntry("zip");

entry.setSize(outByte.length);

zipOutputStream.putNextEntry(entry);

zipOutputStream.write(outByte);

zipOutputStream.closeEntry();

zipOutputStream.close();

你可能感兴趣的:(文件流压缩)