jdk/src/share/classes/java/util/zip/ZipConstants.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1995-1996 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.util.zip;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * This interface defines the constants that are used by the classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * which manipulate ZIP files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * @author      David Connelly
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
interface ZipConstants {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
     * Header signatures
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
    static long LOCSIG = 0x04034b50L;   // "PK\003\004"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
    static long EXTSIG = 0x08074b50L;   // "PK\007\008"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    static long CENSIG = 0x02014b50L;   // "PK\001\002"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    static long ENDSIG = 0x06054b50L;   // "PK\005\006"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
     * Header sizes in bytes (including signatures)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    static final int LOCHDR = 30;       // LOC header size
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    static final int EXTHDR = 16;       // EXT header size
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    static final int CENHDR = 46;       // CEN header size
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    static final int ENDHDR = 22;       // END header size
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     * Local file (LOC) header field offsets
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    static final int LOCVER = 4;        // version needed to extract
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    static final int LOCFLG = 6;        // general purpose bit flag
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    static final int LOCHOW = 8;        // compression method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    static final int LOCTIM = 10;       // modification time
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    static final int LOCCRC = 14;       // uncompressed file crc-32 value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    static final int LOCSIZ = 18;       // compressed size
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    static final int LOCLEN = 22;       // uncompressed size
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    static final int LOCNAM = 26;       // filename length
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    static final int LOCEXT = 28;       // extra field length
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * Extra local (EXT) header field offsets
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    static final int EXTCRC = 4;        // uncompressed file crc-32 value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    static final int EXTSIZ = 8;        // compressed size
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    static final int EXTLEN = 12;       // uncompressed size
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * Central directory (CEN) header field offsets
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    static final int CENVEM = 4;        // version made by
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    static final int CENVER = 6;        // version needed to extract
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    static final int CENFLG = 8;        // encrypt, decrypt flags
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    static final int CENHOW = 10;       // compression method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    static final int CENTIM = 12;       // modification time
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    static final int CENCRC = 16;       // uncompressed file crc-32 value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    static final int CENSIZ = 20;       // compressed size
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    static final int CENLEN = 24;       // uncompressed size
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    static final int CENNAM = 28;       // filename length
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    static final int CENEXT = 30;       // extra field length
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    static final int CENCOM = 32;       // comment length
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    static final int CENDSK = 34;       // disk number start
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    static final int CENATT = 36;       // internal file attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    static final int CENATX = 38;       // external file attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    static final int CENOFF = 42;       // LOC header offset
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * End of central directory (END) header field offsets
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    static final int ENDSUB = 8;        // number of entries on this disk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    static final int ENDTOT = 10;       // total number of entries
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    static final int ENDSIZ = 12;       // central directory size in bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    static final int ENDOFF = 16;       // offset of first CEN header
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    static final int ENDCOM = 20;       // zip file comment length
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
}