OSDN Git Service

Increase buffer size of input stream
authorHiroshi Miura <miurahr@linux.com>
Tue, 18 Jan 2022 00:09:52 +0000 (09:09 +0900)
committerHiroshi Miura <miurahr@linux.com>
Tue, 18 Jan 2022 00:09:52 +0000 (09:09 +0900)
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
dictzip-lib/src/main/java/org/dict/zip/DictZipInputStream.java

index a0a142c..15df4f3 100644 (file)
@@ -40,12 +40,12 @@ public class DictZipInputStream extends InflaterInputStream {
     /**
      * DictZip Header.
      */
-    private DictZipHeader header = null;
+    private DictZipHeader header;
 
     /**
      * CRC-32 for uncompressed data.
      */
-    private CRC32 crc = new CRC32();
+    private final CRC32 crc = new CRC32();
 
     private long crcVal = 0;
     private long totalLength = 0;
@@ -144,7 +144,7 @@ public class DictZipInputStream extends InflaterInputStream {
         if (offset > 0) {
             int total;
             int len;
-            byte[] b = new byte[512];
+            byte[] b = new byte[BUF_LEN];
             for (total = 0; total < offset; total += len) {
                 len = offset - total;
                 if (len > b.length) {