You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by GitBox <gi...@apache.org> on 2021/03/13 11:51:34 UTC

[GitHub] [ant] bodewig commented on a change in pull request #145: Override ZipOutputStream.write(int)

bodewig commented on a change in pull request #145:
URL: https://github.com/apache/ant/pull/145#discussion_r593741630



##########
File path: src/main/org/apache/tools/zip/ZipOutputStream.java
##########
@@ -901,6 +901,20 @@ public boolean canWriteEntryData(ZipEntry ae) {
         return ZipUtil.canHandleEntryData(ae);
     }
 
+    /**
+     * Writes a byte to ZIP entry.
+     *
+     * @param b the byte to write
+     * @throws IOException on error
+     * @since Ant 1.10.10
+     */
+    @Override
+    public void write(int b) throws IOException {
+        byte[] buf = new byte[1];

Review comment:
       We could allocate a one-byte array and reuse that for all calls. Of course then we'd need to think about thread safety issues. So maybe that's not wort the trouble given that so far nobody seems to have used that method anyway :-)




----------------------------------------------------------------
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:
users@infra.apache.org



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