home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / util / zip / ZipConstants.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  3.3 KB  |  89 lines

  1. /*
  2.  * @(#)ZipConstants.java    1.12 98/03/18
  3.  *
  4.  * Copyright 1995-1997 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.util.zip;
  16.  
  17. /*
  18.  * This interface defines the constants that are used by the classes
  19.  * which manipulate ZIP files.
  20.  *
  21.  * @version    1.12, 03/18/98
  22.  * @author    David Connelly
  23.  */
  24. interface ZipConstants {
  25.     /*
  26.      * Header signatures
  27.      */
  28.     static long LOCSIG = 0x04034b50L;    // "PK\003\004"
  29.     static long EXTSIG = 0x08074b50L;    // "PK\007\008"
  30.     static long CENSIG = 0x02014b50L;    // "PK\001\002"
  31.     static long ENDSIG = 0x06054b50L;    // "PK\005\006"
  32.  
  33.     /*
  34.      * Header sizes in bytes (including signatures)
  35.      */
  36.     static final int LOCHDR = 30;    // LOC header size
  37.     static final int EXTHDR = 16;    // EXT header size
  38.     static final int CENHDR = 46;    // CEN header size
  39.     static final int ENDHDR = 22;    // END header size
  40.  
  41.     /*
  42.      * Local file (LOC) header field offsets
  43.      */
  44.     static final int LOCVER = 4;    // version needed to extract
  45.     static final int LOCFLG = 6;    // general purpose bit flag
  46.     static final int LOCHOW = 8;    // compression method
  47.     static final int LOCTIM = 10;    // modification time
  48.     static final int LOCCRC = 14;    // uncompressed file crc-32 value
  49.     static final int LOCSIZ = 18;    // compressed size
  50.     static final int LOCLEN = 22;    // uncompressed size
  51.     static final int LOCNAM = 26;    // filename length
  52.     static final int LOCEXT = 28;    // extra field length
  53.  
  54.     /*
  55.      * Extra local (EXT) header field offsets
  56.      */
  57.     static final int EXTCRC = 4;    // uncompressed file crc-32 value
  58.     static final int EXTSIZ = 8;    // compressed size
  59.     static final int EXTLEN = 12;    // uncompressed size
  60.  
  61.     /*
  62.      * Central directory (CEN) header field offsets
  63.      */
  64.     static final int CENVEM = 4;    // version made by
  65.     static final int CENVER = 6;    // version needed to extract
  66.     static final int CENFLG = 8;    // encrypt, decrypt flags
  67.     static final int CENHOW = 10;    // compression method
  68.     static final int CENTIM = 12;    // modification time
  69.     static final int CENCRC = 16;    // uncompressed file crc-32 value
  70.     static final int CENSIZ = 20;    // compressed size
  71.     static final int CENLEN = 24;    // uncompressed size
  72.     static final int CENNAM = 28;    // filename length
  73.     static final int CENEXT = 30;    // extra field length
  74.     static final int CENCOM = 32;    // comment length
  75.     static final int CENDSK = 34;    // disk number start
  76.     static final int CENATT = 36;    // internal file attributes
  77.     static final int CENATX = 38;    // external file attributes
  78.     static final int CENOFF = 42;    // LOC header offset
  79.  
  80.     /*
  81.      * End of central directory (END) header field offsets
  82.      */
  83.     static final int ENDSUB = 8;    // number of entries on this disk
  84.     static final int ENDTOT = 10;    // total number of entries
  85.     static final int ENDSIZ = 12;    // central directory size in bytes
  86.     static final int ENDOFF = 16;    // offset of first CEN header
  87.     static final int ENDCOM = 20;    // zip file comment length
  88. }
  89.