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 */ 18 package org.apache.commons.compress.archivers.zip; 19 20 /** 21 * Various constants used throughout the package. 22 * 23 * @since 1.3 24 */ 25 final class ZipConstants { 26 /** Masks last eight bits */ 27 static final int BYTE_MASK = 0xFF; 28 29 /** length of a ZipShort in bytes */ 30 static final int SHORT = 2; 31 32 /** length of a ZipLong in bytes */ 33 static final int WORD = 4; 34 35 /** length of a ZipEightByteInteger in bytes */ 36 static final int DWORD = 8; 37 38 /** Initial ZIP specification version */ 39 static final int INITIAL_VERSION = 10; 40 41 /** 42 * ZIP specification version that introduced DEFLATE compression method. 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 55 * extensions are used. 56 */ 57 static final int ZIP64_MAGIC_SHORT = 0xFFFF; 58 59 /** 60 * Value stored in four-byte size and similar fields if ZIP64 61 * extensions are used. 62 */ 63 static final long ZIP64_MAGIC = 0xFFFFFFFFL; 64 ZipConstants()65 private ZipConstants() { } 66 67 } 68