| ZipConstants.java |
1 /*
2 * %W% %E%
3 *
4 * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
5 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6 */
7
8 package java.util.zip;
9
10 /*
11 * This interface defines the constants that are used by the classes
12 * which manipulate ZIP files.
13 *
14 * @version %I%, %G%
15 * @author David Connelly
16 */
17 interface ZipConstants {
18 /*
19 * Header signatures
20 */
21 static long LOCSIG = 0x04034b50L; // "PK\003\004"
22 static long EXTSIG = 0x08074b50L; // "PK\007\008"
23 static long CENSIG = 0x02014b50L; // "PK\001\002"
24 static long ENDSIG = 0x06054b50L; // "PK\005\006"
25
26 /*
27 * Header sizes in bytes (including signatures)
28 */
29 static final int LOCHDR = 30; // LOC header size
30 static final int EXTHDR = 16; // EXT header size
31 static final int CENHDR = 46; // CEN header size
32 static final int ENDHDR = 22; // END header size
33
34 /*
35 * Local file (LOC) header field offsets
36 */
37 static final int LOCVER = 4; // version needed to extract
38 static final int LOCFLG = 6; // general purpose bit flag
39 static final int LOCHOW = 8; // compression method
40 static final int LOCTIM = 10; // modification time
41 static final int LOCCRC = 14; // uncompressed file crc-32 value
42 static final int LOCSIZ = 18; // compressed size
43 static final int LOCLEN = 22; // uncompressed size
44 static final int LOCNAM = 26; // filename length
45 static final int LOCEXT = 28; // extra field length
46
47 /*
48 * Extra local (EXT) header field offsets
49 */
50 static final int EXTCRC = 4; // uncompressed file crc-32 value
51 static final int EXTSIZ = 8; // compressed size
52 static final int EXTLEN = 12; // uncompressed size
53
54 /*
55 * Central directory (CEN) header field offsets
56 */
57 static final int CENVEM = 4; // version made by
58 static final int CENVER = 6; // version needed to extract
59 static final int CENFLG = 8; // encrypt, decrypt flags
60 static final int CENHOW = 10; // compression method
61 static final int CENTIM = 12; // modification time
62 static final int CENCRC = 16; // uncompressed file crc-32 value
63 static final int CENSIZ = 20; // compressed size
64 static final int CENLEN = 24; // uncompressed size
65 static final int CENNAM = 28; // filename length
66 static final int CENEXT = 30; // extra field length
67 static final int CENCOM = 32; // comment length
68 static final int CENDSK = 34; // disk number start
69 static final int CENATT = 36; // internal file attributes
70 static final int CENATX = 38; // external file attributes
71 static final int CENOFF = 42; // LOC header offset
72
73 /*
74 * End of central directory (END) header field offsets
75 */
76 static final int ENDSUB = 8; // number of entries on this disk
77 static final int ENDTOT = 10; // total number of entries
78 static final int ENDSIZ = 12; // central directory size in bytes
79 static final int ENDOFF = 16; // offset of first CEN header
80 static final int ENDCOM = 20; // zip file comment length
81 }
82