Package org.apache.tools.zip
Class GeneralPurposeBit
java.lang.Object
org.apache.tools.zip.GeneralPurposeBit
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intIndicates that filenames are written in utf-8.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionclone()byte[]encode()Encodes the set bits in a form suitable for ZIP archives.voidencode(byte[] buf, int offset) Encodes the set bits in a form suitable for ZIP archives.booleaninthashCode()static GeneralPurposeBitparse(byte[] data, int offset) Parses the supported flags from the given archive data.voiduseDataDescriptor(boolean b) whether the current entry will use the data descriptor to store CRC and size informationvoiduseEncryption(boolean b) whether the current entry will be encryptedbooleanwhether the current entry uses the data descriptor to store CRC and size informationbooleanwhether the current entry is encryptedbooleanwhether the current entry is encrypted using strong encryptionvoiduseStrongEncryption(boolean b) whether the current entry will be encrypted using strong encryptionbooleanwhether the current entry uses UTF8 for file name and comment.voiduseUTF8ForNames(boolean b) whether the current entry will use UTF8 for file name and comment.
- 
Field Details- 
UFT8_NAMES_FLAGpublic static final int UFT8_NAMES_FLAGIndicates that filenames are written in utf-8.The only reason this is public is that ZipOutputStream.EFS_FLAGwas public in several versions of Apache Ant and we needed a substitute for it.- See Also:
 
 
- 
- 
Constructor Details- 
GeneralPurposeBitpublic GeneralPurposeBit()
 
- 
- 
Method Details- 
usesUTF8ForNamespublic boolean usesUTF8ForNames()whether the current entry uses UTF8 for file name and comment.- Returns:
- boolean
 
- 
useUTF8ForNamespublic void useUTF8ForNames(boolean b) whether the current entry will use UTF8 for file name and comment.- Parameters:
- b- boolean
 
- 
usesDataDescriptorpublic boolean usesDataDescriptor()whether the current entry uses the data descriptor to store CRC and size information- Returns:
- boolean
 
- 
useDataDescriptorpublic void useDataDescriptor(boolean b) whether the current entry will use the data descriptor to store CRC and size information- Parameters:
- b- boolean
 
- 
usesEncryptionpublic boolean usesEncryption()whether the current entry is encrypted- Returns:
- boolean
 
- 
useEncryptionpublic void useEncryption(boolean b) whether the current entry will be encrypted- Parameters:
- b- boolean
 
- 
usesStrongEncryptionpublic boolean usesStrongEncryption()whether the current entry is encrypted using strong encryption- Returns:
- boolean
 
- 
useStrongEncryptionpublic void useStrongEncryption(boolean b) whether the current entry will be encrypted using strong encryption- Parameters:
- b- boolean
 
- 
encodepublic byte[] encode()Encodes the set bits in a form suitable for ZIP archives.- Returns:
- byte[]
 
- 
encodepublic void encode(byte[] buf, int offset) Encodes the set bits in a form suitable for ZIP archives.- Parameters:
- buf- the output buffer
- offset- The offset within the output buffer of the first byte to be written. must be non-negative and no larger than- buf.length-2
 
- 
parseParses the supported flags from the given archive data.- Parameters:
- data- local file header or a central directory entry.
- offset- offset at which the general purpose bit starts
- Returns:
- GeneralPurposeBit
 
- 
hashCode
- 
equals
- 
clone
 
-