Notes for using java.util.zip

Source: Internet
Author: User
1. If there is a path when compressing the file, you also need to use putentry for each level of path.
2. If you want to use zipentry. setmethod (zipentry. sttored) values of size, compression, and CRC must be set. If no compression is performed, the value of size and compression must be the same. The value of size is easy to obtain, that is, the length of the compressed data in bytes, but where is the CRC value? The java.util.zip. CRC class provides this function. You can first use CRC. Update (); then you can get the CRC value from CRC. getvalue.
3. java.uitl.zipdoes not support Chinese keywords and file names. If you want to solve this problem, you do not need to use the java.util.zip package. You can use the package in Apach.

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.