Java???Gzip
???????????? ???????[ 2014/12/18 11:25:25 ] ????????Java ??????? ????
????------------------------------------------------------------
?????????????
??????java.util.zip ?а????????????????????????????????????zip??gzip??????????????
????java.util.zip ????6?????????????????????????????????????????????????
public class DeflaterOuputStream extends FilterOutpuStream
public class InflaterInputStream extends FilterInputStream
public class GZIPOutputStream extends FilterOutputStream
public class GZIPInputStream extends FilterInputStream
public class ZipOutputStream extends FilterOutputStream
public class ZipInputStream extends FilterInputStream
???????? FileInputStream ?????????????GZIPInputStream?????FileInputStream ?????????磺
????FileInputStream fin = new FileInputStream("aaa.gz");
????GZIPInputStream gzin = new GZIPInputStream(fin);
?????????????????read()??skip()??available() ?????????gzin ?ж??????????
----------------------
FileInputStream fin = new FileInputStream("aa.gz");
GZIPInputStream gzin = new GZIPInputStream(fin);
FileOutputStream fout = new FileOutputStream("aa");
int b = 0;
while ((b == gzin.read() != -1)) fout.write(b);
gzin.close();
out.flush();
out.close();
????ZipOutputStream ????????????zip?????????????ZipEntry????????
???????£?
FileInputStream fin = new FileInputStream("aaa.zip");
ZipInputStream zin = new ZipInputStream(fin);
ZipEntry ze = null;
int b = 0;
while ((ze = zin.getNextEntry()) != null) {
FileOutputStream fout = new FileOutputStream(ze.getName());
while ((b = zin.read()) != -1) fout.write(b);
zin.closeEntry();
fout.flush();
fout.close();
}
zin.close();
——------------------------------------
THANKS
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11