10,607
社区成员
发帖
与我相关
我的任务
分享
InputStream in = connection.getInputStream();
GZIPInputStream gzin = new GZIPInputStream(in);
FileOutputStream file = new FileOutputStream(new File("F:\\123.gif"));
byte[] bytes = new byte[1024*1024];
int length = 0;
while((length=gzin.read(bytes))!=-1){
file.write(bytes,0,length);
}
file.write(bytes, 0, length);
file.close();
in.close();
OutputStream out = this.getResponse().getOutputStream();
out.write(这里写内容);
out.flush();
out.close();