-
- All Implemented Interfaces:
-
java.lang.Cloneable
public final class GeneralPurposeBit implements Cloneable
Parser/encoder for the "general purpose bit" field in ZIP's local file and central directory headers.
-
-
Field Summary
Fields Modifier and Type Field Description public final static intUFT8_NAMES_FLAG
-
Constructor Summary
Constructors Constructor Description GeneralPurposeBit()
-
Method Summary
Modifier and Type Method Description static GeneralPurposeBitparse(Array<byte> data, int offset)Parses the supported flags from the given archive data. Objectclone()Array<byte>encode()Encodes the set bits in a form suitable for ZIP archives. voidencode(Array<byte> buf, int offset)Encodes the set bits in a form suitable for ZIP archives. booleanequals(Object o)inthashCode()voiduseDataDescriptor(boolean b)whether the current entry will use the data descriptor to storeCRC and size information. voiduseEncryption(boolean b)whether the current entry will be encrypted. booleanusesDataDescriptor()whether the current entry uses the data descriptor to store CRCand size information. booleanusesEncryption()whether the current entry is encrypted. booleanusesStrongEncryption()whether the current entry is encrypted using strong encryption. voiduseStrongEncryption(boolean b)whether the current entry will be encrypted using strong encryption. booleanusesUTF8ForNames()whether 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. -
-
Method Detail
-
parse
static GeneralPurposeBit parse(Array<byte> data, int offset)
Parses 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
-
encode
void encode(Array<byte> buf, int offset)
Encodes the set bits in a form suitable for ZIP archives.
- Parameters:
buf- the output bufferoffset- The offset within the output buffer of the first byte to be written.
-
hashCode
int hashCode()
-
useDataDescriptor
void useDataDescriptor(boolean b)
whether the current entry will use the data descriptor to storeCRC and size information.
- Parameters:
b- whether the current entry will use the data descriptor to storeCRC and size information
-
useEncryption
void useEncryption(boolean b)
whether the current entry will be encrypted.
- Parameters:
b- whether the current entry will be encrypted
-
usesDataDescriptor
boolean usesDataDescriptor()
whether the current entry uses the data descriptor to store CRCand size information.
-
usesEncryption
boolean usesEncryption()
whether the current entry is encrypted.
-
usesStrongEncryption
boolean usesStrongEncryption()
whether the current entry is encrypted using strong encryption.
-
useStrongEncryption
void useStrongEncryption(boolean b)
whether the current entry will be encrypted using strong encryption.
- Parameters:
b- whether the current entry will be encrypted using strong encryption
-
usesUTF8ForNames
boolean usesUTF8ForNames()
whether the current entry uses UTF8 for file name and comment.
-
useUTF8ForNames
void useUTF8ForNames(boolean b)
whether the current entry will use UTF8 for file name and comment.
- Parameters:
b- whether the current entry will use UTF8 for file name and comment.
-
-
-
-