1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 package org.apache.commons.compress.archivers.zip; 18 19 /** 20 * Various constants used throughout the package. 21 * 22 * @since 1.3 23 */ 24 final class ZipConstants { 25 /** Masks last eight bits */ 26 static final int BYTE_MASK = 0xFF; 27 28 /** Length of a ZipShort in bytes */ 29 static final int SHORT = 2; 30 31 /** Length of a ZipLong in bytes */ 32 static final int WORD = 4; 33 34 /** Length of a ZipEightByteInteger in bytes */ 35 static final int DWORD = 8; 36 37 /** Initial ZIP specification version */ 38 static final int INITIAL_VERSION = 10; 39 40 /** 41 * ZIP specification version that introduced DEFLATE compression method. 42 * 43 * @since 1.15 44 */ 45 static final int DEFLATE_MIN_VERSION = 20; 46 47 /** ZIP specification version that introduced data descriptor method */ 48 static final int DATA_DESCRIPTOR_MIN_VERSION = 20; 49 50 /** ZIP specification version that introduced ZIP64 */ 51 static final int ZIP64_MIN_VERSION = 45; 52 53 /** 54 * Value stored in two-byte size and similar fields if ZIP64 extensions are used. 55 */ 56 static final int ZIP64_MAGIC_SHORT = 0xFFFF; 57 58 /** 59 * Value stored in four-byte size and similar fields if ZIP64 extensions are used. 60 */ 61 static final long ZIP64_MAGIC = 0xFFFFFFFFL; 62 63 private ZipConstants() { 64 } 65 66 }