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 <[email protected]> Authored: Thu Dec 8 23:44:01 2016 -0800 Committer: Gary Gregory <[email protected]> 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);
