commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1428946 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
Date Fri, 04 Jan 2013 16:07:01 GMT
Author: bodewig
Date: Fri Jan  4 16:07:01 2013
New Revision: 1428946

URL: http://svn.apache.org/viewvc?rev=1428946&view=rev
Log:
micro optimization

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java?rev=1428946&r1=1428945&r2=1428946&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
Fri Jan  4 16:07:01 2013
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.io.StringWriter;
 import java.nio.ByteBuffer;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.commons.compress.archivers.ArchiveEntry;
@@ -510,10 +511,7 @@ public class TarArchiveOutputStream exte
      * An EOF record consists of a record of all zeros.
      */
     private void writeEOFRecord() throws IOException {
-        for (int i = 0; i < recordBuf.length; ++i) {
-            recordBuf[i] = 0;
-        }
-
+        Arrays.fill(recordBuf, (byte) 0);
         buffer.writeRecord(recordBuf);
     }
 



Mime
View raw message