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