emul/mini/src/main/java/org/apidesign/bck2brwsr/emul/zip/ZipConstants64.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 07 Feb 2013 12:58:12 +0100
branchemul
changeset 694 0d277415ed02
parent 609 emul/mini/src/main/java/java/util/zip/ZipConstants64.java@48ef38e9677e
permissions -rw-r--r--
Rebasing the Inflater support on jzlib which, unlike GNU ClassPath, has correct implementation of Huffman code. Making the implementation more easily testable by turning Inflater and ZipInputStream into pure delegates. Current implementation is going to need proper long support.
     1 /*
     2  * Copyright (c) 1995, 1996, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Oracle in the LICENSE file that accompanied this code.
    10  *
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  * version 2 for more details (a copy is included in the LICENSE file that
    15  * accompanied this code).
    16  *
    17  * You should have received a copy of the GNU General Public License version
    18  * 2 along with this work; if not, write to the Free Software Foundation,
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  *
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22  * or visit www.oracle.com if you need additional information or have any
    23  * questions.
    24  */
    25 
    26 package org.apidesign.bck2brwsr.emul.zip;
    27 
    28 /*
    29  * This class defines the constants that are used by the classes
    30  * which manipulate Zip64 files.
    31  */
    32 
    33 public class ZipConstants64 {
    34 
    35     /*
    36      * ZIP64 constants
    37      */
    38     static final long ZIP64_ENDSIG = 0x06064b50L;  // "PK\006\006"
    39     static final long ZIP64_LOCSIG = 0x07064b50L;  // "PK\006\007"
    40     static final int  ZIP64_ENDHDR = 56;           // ZIP64 end header size
    41     static final int  ZIP64_LOCHDR = 20;           // ZIP64 end loc header size
    42     static final int  ZIP64_EXTHDR = 24;           // EXT header size
    43     static final int  ZIP64_EXTID  = 0x0001;       // Extra field Zip64 header ID
    44 
    45     static final int  ZIP64_MAGICCOUNT = 0xFFFF;
    46     static final long ZIP64_MAGICVAL = 0xFFFFFFFFL;
    47 
    48     /*
    49      * Zip64 End of central directory (END) header field offsets
    50      */
    51     static final int  ZIP64_ENDLEN = 4;       // size of zip64 end of central dir
    52     static final int  ZIP64_ENDVEM = 12;      // version made by
    53     static final int  ZIP64_ENDVER = 14;      // version needed to extract
    54     static final int  ZIP64_ENDNMD = 16;      // number of this disk
    55     static final int  ZIP64_ENDDSK = 20;      // disk number of start
    56     static final int  ZIP64_ENDTOD = 24;      // total number of entries on this disk
    57     static final int  ZIP64_ENDTOT = 32;      // total number of entries
    58     static final int  ZIP64_ENDSIZ = 40;      // central directory size in bytes
    59     static final int  ZIP64_ENDOFF = 48;      // offset of first CEN header
    60     static final int  ZIP64_ENDEXT = 56;      // zip64 extensible data sector
    61 
    62     /*
    63      * Zip64 End of central directory locator field offsets
    64      */
    65     static final int  ZIP64_LOCDSK = 4;       // disk number start
    66     static final int  ZIP64_LOCOFF = 8;       // offset of zip64 end
    67     static final int  ZIP64_LOCTOT = 16;      // total number of disks
    68 
    69     /*
    70      * Zip64 Extra local (EXT) header field offsets
    71      */
    72     static final int  ZIP64_EXTCRC = 4;       // uncompressed file crc-32 value
    73     static final int  ZIP64_EXTSIZ = 8;       // compressed size, 8-byte
    74     static final int  ZIP64_EXTLEN = 16;      // uncompressed size, 8-byte
    75 
    76     /*
    77      * Language encoding flag EFS
    78      */
    79     static final int EFS = 0x800;       // If this bit is set the filename and
    80                                         // comment fields for this file must be
    81                                         // encoded using UTF-8.
    82 
    83     private ZipConstants64() {}
    84 }