Java.util.zip. DataFormatException: invalid distance too far back, afaroffdistance

Source: Internet
Author: User

Java.util.zip. DataFormatException: invalid distance too far back, afaroffdistance

The following error occurs when extracting war/jar files:
Java.util.zip. ZipException: invalid distance too far back
At org.apache.commons.compress.archivers.zip. ZipArchiveInputStream. readFromInflater (ZipArchiveInputStream. java: 478)
At org.apache.commons.compress.archivers.zip. ZipArchiveInputStream. readDeflated (ZipArchiveInputStream. java: 443)
At org.apache.commons.compress.archivers.zip. ZipArchiveInputStream. read (ZipArchiveInputStream. java: 384)
At java. io. InputStream. read (Unknown Source)
At org. apache. commons. compress. utils. IOUtils. copy (IOUtils. java: 75)
At org. apache. commons. compress. utils. IOUtils. copy (IOUtils. java: 56)
At com. xunge. AESFileEncoder $ 1.run( AESFileEncoder. java: 149)
At java. lang. Thread. run (Unknown Source)
Caused by: java.util.zip. DataFormatException: invalid distance too far back
At java.util.zip. Inflater. inflateBytes (Native Method)
At java.util.zip. Inflater. inflate (Unknown Source)
At org.apache.commons.compress.archivers.zip. ZipArchiveInputStream. readFromInflater (ZipArchiveInputStream. java: 476)
... 7 more

Related code:

PipedInputStream pin = new PipedInputStream();                    PipedOutputStream pout = new PipedOutputStream(pin);                    new Thread(new Runnable() {                        public void run() {                            try {                                IOUtils.copy(ais, pout);                                pout.close();                            } catch (IOException e) {                                // TODO Auto-generated catch block                                e.printStackTrace();                            }                        }                    }).start();                    ArchiveInputStream inJar = new ArchiveStreamFactory()                            .createArchiveInputStream(ArchiveStreamFactory.JAR,                                    pin);

There is no problem with the above Code. If the code using the pin is separated by too many codes in the pin declaration code, this exception will occur. The specific failure to perform the test may also be the cause of the logic judgment statement.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.