|
|
@ -163,11 +163,12 @@ public class FileUtils
|
|
|
|
bufIn = new BufferedInputStream(file.openStream());
|
|
|
|
bufIn = new BufferedInputStream(file.openStream());
|
|
|
|
zipEntry = new ZipEntry(filePath.get("downloadPath").toString());
|
|
|
|
zipEntry = new ZipEntry(filePath.get("downloadPath").toString());
|
|
|
|
zipOutputStream.putNextEntry(zipEntry);
|
|
|
|
zipOutputStream.putNextEntry(zipEntry);
|
|
|
|
int length = 0;
|
|
|
|
// int length = 0;
|
|
|
|
while ((length = bufIn.read()) != -1)
|
|
|
|
// while ((length = bufIn.read()) != -1)
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
zipOutputStream.write(length);
|
|
|
|
// zipOutputStream.write(length);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
IOUtils.copy(bufIn,zipOutputStream);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (IOException e)
|
|
|
|
catch (IOException e)
|
|
|
@ -213,12 +214,13 @@ public class FileUtils
|
|
|
|
bufIn = new BufferedInputStream(file.openStream());
|
|
|
|
bufIn = new BufferedInputStream(file.openStream());
|
|
|
|
zipEntry = new ZipEntry(filePath.get("downloadPath").toString());
|
|
|
|
zipEntry = new ZipEntry(filePath.get("downloadPath").toString());
|
|
|
|
zipOutputStream.putNextEntry(zipEntry);
|
|
|
|
zipOutputStream.putNextEntry(zipEntry);
|
|
|
|
byte[] b = new byte[1024*4];
|
|
|
|
// byte[] b = new byte[1024*4];
|
|
|
|
int length;
|
|
|
|
// int length;
|
|
|
|
while ((length = bufIn.read(b)) > 0)
|
|
|
|
// while ((length = bufIn.read(b)) > 0)
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
zipOutputStream.write(b, 0, length);
|
|
|
|
// zipOutputStream.write(b, 0, length);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
IOUtils.copy(bufIn,zipOutputStream);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (IOException e)
|
|
|
|
catch (IOException e)
|
|
|
|