commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject commons-compress git commit: Refactor magic number.
Date Fri, 09 Dec 2016 07:44:03 GMT
Repository: commons-compress
Updated Branches:
  refs/heads/master a214d4c16 -> 7145b4a3d


Refactor magic number.

Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/7145b4a3
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/7145b4a3
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/7145b4a3

Branch: refs/heads/master
Commit: 7145b4a3d1fd2385f59595b890327a6c451188a7
Parents: a214d4c
Author: Gary Gregory <ggregory@apache.org>
Authored: Thu Dec 8 23:44:01 2016 -0800
Committer: Gary Gregory <ggregory@apache.org>
Committed: Thu Dec 8 23:44:01 2016 -0800

----------------------------------------------------------------------
 .../apache/commons/compress/archivers/ArchiveStreamFactory.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/7145b4a3/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
b/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
index 6abc91e..82fcaef 100644
--- a/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
+++ b/src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
@@ -88,6 +88,8 @@ import org.apache.commons.compress.utils.Sets;
  */
 public class ArchiveStreamFactory implements ArchiveStreamProvider {
 
+    private static final int SIGNATURE_SIZE = 12;
+
     private static final ArchiveStreamFactory SINGLETON = new ArchiveStreamFactory();
     
     /**
@@ -475,7 +477,7 @@ public class ArchiveStreamFactory implements ArchiveStreamProvider {
             throw new IllegalArgumentException("Mark is not supported.");
         }
 
-        final byte[] signature = new byte[12];
+        final byte[] signature = new byte[SIGNATURE_SIZE];
         in.mark(signature.length);
         try {
             int signatureLength = IOUtils.readFully(in, signature);


Mime
View raw message