What is the idiomatic way to copy a ZipEntry into a new ZipFile?
问题 I'm writing a tool to do some minor text replacement in a DOCX file, which is a zipped format. My method is to copy ZipEntry contents from entries in the original file into the modified file using a ZipOutputStream . For most DOCX files this works well, but occasionally I will encounter ZipException s regarding discrepancies between the contents I've written and the meta-information contained in the ZipEntry (usually a difference in compressed size). Here's the code I'm using to copy over