ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ant] bodewig commented on a change in pull request #145: Override ZipOutputStream.write(int)
Date Sat, 13 Mar 2021 11:51:34 GMT

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


Mime
View raw message