Java 压缩Pcap文件时出现的问题
我正在生成pcap文件,需要压缩它。目前,我能够生成pcap文件并将其存储在本地存储器中Java 压缩Pcap文件时出现的问题,java,android,Java,Android,我正在生成pcap文件,需要压缩它。目前,我能够生成pcap文件并将其存储在本地存储器中 对于压缩,我使用以下代码: @Override protected void onPreExecute() { super.onPreExecute(); } @Override protected String doInBackground(String... urls) { byte[] buffer = new byte[1024]; try { zipFil
对于压缩,我使用以下代码:
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected String doInBackground(String... urls) {
byte[] buffer = new byte[1024];
try {
zipFilePath = urls[0];
FileOutputStream fos = new FileOutputStream(zipFilePath + ".zip");
ZipOutputStream zos = new ZipOutputStream(fos);
ZipEntry ze = new ZipEntry(urls[1]);
zos.putNextEntry(ze);
FileInputStream in = new FileInputStream(zipFilePath);
int len;
while ((len = in.read(buffer)) > 0) {
zos.write(buffer, 0, len);
}
in.close();
zos.closeEntry();
//remember close it
zos.close();
return zipFilePath + ".zip";
} catch (IOException ex) {
ex.printStackTrace();
return "";
}
}
我在FileOutputStream fos=newfileoutputstream(zipFilePath+“.zip”)处发现filenotfound
异常代码>