home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / ZipConstants.java < prev    next >
Text File  |  1997-05-20  |  4KB  |  97 lines

  1. /*
  2.  * @(#)ZipConstants.java    1.10 96/11/24
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22.  
  23. package java.util.zip;
  24.  
  25. /*
  26.  * This interface defines the constants that are used by the classes
  27.  * which manipulate ZIP files.
  28.  *
  29.  * @version    1.10, 11/24/96
  30.  * @author    David Connelly
  31.  */
  32. interface ZipConstants {
  33.     /*
  34.      * Header signatures
  35.      */
  36.     static long LOCSIG = 0x04034b50L;    // "PK\003\004"
  37.     static long EXTSIG = 0x08074b50L;    // "PK\007\008"
  38.     static long CENSIG = 0x02014b50L;    // "PK\001\002"
  39.     static long ENDSIG = 0x06054b50L;    // "PK\005\006"
  40.  
  41.     /*
  42.      * Header sizes in bytes (including signatures)
  43.      */
  44.     static final int LOCHDR = 30;    // LOC header size
  45.     static final int EXTHDR = 16;    // EXT header size
  46.     static final int CENHDR = 46;    // CEN header size
  47.     static final int ENDHDR = 22;    // END header size
  48.  
  49.     /*
  50.      * Local file (LOC) header field offsets
  51.      */
  52.     static final int LOCVER = 4;    // version needed to extract
  53.     static final int LOCFLG = 6;    // general purpose bit flag
  54.     static final int LOCHOW = 8;    // compression method
  55.     static final int LOCTIM = 10;    // modification time
  56.     static final int LOCCRC = 14;    // uncompressed file crc-32 value
  57.     static final int LOCSIZ = 18;    // compressed size
  58.     static final int LOCLEN = 22;    // uncompressed size
  59.     static final int LOCNAM = 26;    // filename length
  60.     static final int LOCEXT = 28;    // extra field length
  61.  
  62.     /*
  63.      * Extra local (EXT) header field offsets
  64.      */
  65.     static final int EXTCRC = 4;    // uncompressed file crc-32 value
  66.     static final int EXTSIZ = 8;    // compressed size
  67.     static final int EXTLEN = 12;    // uncompressed size
  68.  
  69.     /*
  70.      * Central directory (CEN) header field offsets
  71.      */
  72.     static final int CENVEM = 4;    // version made by
  73.     static final int CENVER = 6;    // version needed to extract
  74.     static final int CENFLG = 8;    // encrypt, decrypt flags
  75.     static final int CENHOW = 10;    // compression method
  76.     static final int CENTIM = 12;    // modification time
  77.     static final int CENCRC = 16;    // uncompressed file crc-32 value
  78.     static final int CENSIZ = 20;    // compressed size
  79.     static final int CENLEN = 24;    // uncompressed size
  80.     static final int CENNAM = 28;    // filename length
  81.     static final int CENEXT = 30;    // extra field length
  82.     static final int CENCOM = 32;    // comment length
  83.     static final int CENDSK = 34;    // disk number start
  84.     static final int CENATT = 36;    // internal file attributes
  85.     static final int CENATX = 38;    // external file attributes
  86.     static final int CENOFF = 42;    // LOC header offset
  87.  
  88.     /*
  89.      * End of central directory (END) header field offsets
  90.      */
  91.     static final int ENDSUB = 8;    // number of entries on this disk
  92.     static final int ENDTOT = 10;    // total number of entries
  93.     static final int ENDSIZ = 12;    // central directory size in bytes
  94.     static final int ENDOFF = 16;    // offset of first CEN header
  95.     static final int ENDCOM = 20;    // zip file comment length
  96. }
  97.