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