文件流压缩

2022-07-07  本文已影响0人  哈维尔23456

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();

上一篇 下一篇

猜你喜欢

热点阅读