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