You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the encrypted compressed zip file, is it supported to use zinInputstream to decompress it directly? Below is my test code and maven dependency, I received the following error. But the same code will work fine for an unencrypted zip package.
maven dependency:
net.lingala.zip4j
zip4j
2.9.1
test code:
public static void main(String[] args) {
String srcPath = "E:\test1.zip";
try {
ZipInputStream zis = new ZipInputStream(new FileInputStream(srcPath), "123".toCharArray());
LocalFileHeader nextEntry = zis.getNextEntry();
while (Objects.nonNull(nextEntry)) {
String fileName = nextEntry.getFileName();
if (!nextEntry.isDirectory()) {
log.info("entry name {}", fileName);
}
nextEntry = zis.getNextEntry();
}
} catch (IOException e) {
e.printStackTrace();
}
}
Error reported:
net.lingala.zip4j.exception.ZipException: Reached end of entry, but crc verification failed for test.txt
The text was updated successfully, but these errors were encountered:
For the encrypted compressed zip file, is it supported to use zinInputstream to decompress it directly? Below is my test code and maven dependency, I received the following error. But the same code will work fine for an unencrypted zip package.
For the encrypted compressed zip file, is it supported to use zinInputstream to decompress it directly? Below is my test code and maven dependency, I received the following error. But the same code will work fine for an unencrypted zip package.
maven dependency:
net.lingala.zip4j
zip4j
2.9.1
test code:
public static void main(String[] args) {
String srcPath = "E:\test1.zip";
try {
ZipInputStream zis = new ZipInputStream(new FileInputStream(srcPath), "123".toCharArray());
LocalFileHeader nextEntry = zis.getNextEntry();
while (Objects.nonNull(nextEntry)) {
String fileName = nextEntry.getFileName();
if (!nextEntry.isDirectory()) {
log.info("entry name {}", fileName);
}
nextEntry = zis.getNextEntry();
}
} catch (IOException e) {
e.printStackTrace();
}
}
Error reported:
net.lingala.zip4j.exception.ZipException: Reached end of entry, but crc verification failed for test.txt
The text was updated successfully, but these errors were encountered: