OSDN Git Service

Refactoring DictZipHeader
authorHiroshi Miura <miurahr@linux.com>
Fri, 15 Apr 2016 13:40:36 +0000 (22:40 +0900)
committerHiroshi Miura <miurahr@linux.com>
Fri, 15 Apr 2016 13:40:36 +0000 (22:40 +0900)
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
dictzip-lib/src/main/java/org/dict/zip/DictZipHeader.java

index 4410d9d..ab53367 100644 (file)
@@ -77,16 +77,11 @@ public class DictZipHeader {
     /**
      * Header fields length.
      */
-    private static final int DICTZIP_HEADER_LEN = 10;
+    private static final int GZIP_HEADER_LEN = 10;
     /* 2 bytes header magic, 1 byte compression method, 1 byte flags
      4 bytes time, 1 byte extra flags, 1 byte OS */
 
     /**
-     * Other constants.
-     */
-    private static final int BUFLEN = 58315; // Same as C implementation
-
-    /**
      * Default constructor.
      */
     private DictZipHeader() {
@@ -132,7 +127,7 @@ public class DictZipHeader {
         chunks = new int[chunkCount];
         // Calculate total length
         extraLength = subfieldLength + 4;
-        headerLength = DICTZIP_HEADER_LEN + extraLength;
+        headerLength = GZIP_HEADER_LEN + extraLength;
         filename = "";
         comment = "";
     }
@@ -225,7 +220,7 @@ public class DictZipHeader {
                 break;
             }
         }
-        h.headerLength = DICTZIP_HEADER_LEN;
+        h.headerLength = GZIP_HEADER_LEN;
         // Optional extra field
         if (h.gzipFlag.get(FEXTRA)) {
             h.extraLength = DictZipFileUtils.readUShort(in);