helfper opened a new pull request #145:
URL: https://github.com/apache/ant/pull/145


   `java.util.zip.ZipOutputStream` extends from 
`java.util.zip.DeflaterOutputStream` which overrides `void write(int b)` to 
redirect its calls to `void write(byte[] b, int off, int len)`.
   
   `org.apache.tools.zip.ZipOutputStream` doesn't extend the same class and 
currently doesn't override `void write(int b)`. This means that calls to this 
method end up in `FilterOutputStream.write(int b)`, which in turn passes them 
through to the underlying `OutputStream`. This bypasses all the logic in 
`ZipOutputStream.write(byte[] b, int offset, int len)` (deflation and whatnot) 
which produces corrupted ZIP files.
   
   One example where the method `void write(int b)` is ultimately invoked is by 
calling `java.util.jar.Manifest.write(zipOutputStream)`.
   
   This PR fixes this by overriding the method `void write(int b)` in 
`org.apache.tools.zip.ZipOutputStream` in the same way as 
`java.util.zip.DeflaterOutputStream` does.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to