1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/emul/mini/src/main/java/java/util/zip/ZipConstants.java Mon Feb 25 19:00:08 2013 +0100
1.3 @@ -0,0 +1,98 @@
1.4 +/*
1.5 + * Copyright (c) 1995, 1996, Oracle and/or its affiliates. All rights reserved.
1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1.7 + *
1.8 + * This code is free software; you can redistribute it and/or modify it
1.9 + * under the terms of the GNU General Public License version 2 only, as
1.10 + * published by the Free Software Foundation. Oracle designates this
1.11 + * particular file as subject to the "Classpath" exception as provided
1.12 + * by Oracle in the LICENSE file that accompanied this code.
1.13 + *
1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1.17 + * version 2 for more details (a copy is included in the LICENSE file that
1.18 + * accompanied this code).
1.19 + *
1.20 + * You should have received a copy of the GNU General Public License version
1.21 + * 2 along with this work; if not, write to the Free Software Foundation,
1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1.23 + *
1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1.25 + * or visit www.oracle.com if you need additional information or have any
1.26 + * questions.
1.27 + */
1.28 +
1.29 +package java.util.zip;
1.30 +
1.31 +/*
1.32 + * This interface defines the constants that are used by the classes
1.33 + * which manipulate ZIP files.
1.34 + *
1.35 + * @author David Connelly
1.36 + */
1.37 +interface ZipConstants {
1.38 + /*
1.39 + * Header signatures
1.40 + */
1.41 + static long LOCSIG = 0x04034b50L; // "PK\003\004"
1.42 + static long EXTSIG = 0x08074b50L; // "PK\007\008"
1.43 + static long CENSIG = 0x02014b50L; // "PK\001\002"
1.44 + static long ENDSIG = 0x06054b50L; // "PK\005\006"
1.45 +
1.46 + /*
1.47 + * Header sizes in bytes (including signatures)
1.48 + */
1.49 + static final int LOCHDR = 30; // LOC header size
1.50 + static final int EXTHDR = 16; // EXT header size
1.51 + static final int CENHDR = 46; // CEN header size
1.52 + static final int ENDHDR = 22; // END header size
1.53 +
1.54 + /*
1.55 + * Local file (LOC) header field offsets
1.56 + */
1.57 + static final int LOCVER = 4; // version needed to extract
1.58 + static final int LOCFLG = 6; // general purpose bit flag
1.59 + static final int LOCHOW = 8; // compression method
1.60 + static final int LOCTIM = 10; // modification time
1.61 + static final int LOCCRC = 14; // uncompressed file crc-32 value
1.62 + static final int LOCSIZ = 18; // compressed size
1.63 + static final int LOCLEN = 22; // uncompressed size
1.64 + static final int LOCNAM = 26; // filename length
1.65 + static final int LOCEXT = 28; // extra field length
1.66 +
1.67 + /*
1.68 + * Extra local (EXT) header field offsets
1.69 + */
1.70 + static final int EXTCRC = 4; // uncompressed file crc-32 value
1.71 + static final int EXTSIZ = 8; // compressed size
1.72 + static final int EXTLEN = 12; // uncompressed size
1.73 +
1.74 + /*
1.75 + * Central directory (CEN) header field offsets
1.76 + */
1.77 + static final int CENVEM = 4; // version made by
1.78 + static final int CENVER = 6; // version needed to extract
1.79 + static final int CENFLG = 8; // encrypt, decrypt flags
1.80 + static final int CENHOW = 10; // compression method
1.81 + static final int CENTIM = 12; // modification time
1.82 + static final int CENCRC = 16; // uncompressed file crc-32 value
1.83 + static final int CENSIZ = 20; // compressed size
1.84 + static final int CENLEN = 24; // uncompressed size
1.85 + static final int CENNAM = 28; // filename length
1.86 + static final int CENEXT = 30; // extra field length
1.87 + static final int CENCOM = 32; // comment length
1.88 + static final int CENDSK = 34; // disk number start
1.89 + static final int CENATT = 36; // internal file attributes
1.90 + static final int CENATX = 38; // external file attributes
1.91 + static final int CENOFF = 42; // LOC header offset
1.92 +
1.93 + /*
1.94 + * End of central directory (END) header field offsets
1.95 + */
1.96 + static final int ENDSUB = 8; // number of entries on this disk
1.97 + static final int ENDTOT = 10; // total number of entries
1.98 + static final int ENDSIZ = 12; // central directory size in bytes
1.99 + static final int ENDOFF = 16; // offset of first CEN header
1.100 + static final int ENDCOM = 20; // zip file comment length
1.101 +}