org.apache.tools.zip

Class AbstractUnicodeExtraField

public abstract class AbstractUnicodeExtraField extends Object implements ZipExtraField

A common base class for Unicode extra information extra fields.
Constructor Summary
protected AbstractUnicodeExtraField()
protected AbstractUnicodeExtraField(String text, byte[] bytes, int off, int len)
Assemble as unicode extension from the name/comment and encoding of the orginal zip entry.
protected AbstractUnicodeExtraField(String text, byte[] bytes)
Assemble as unicode extension from the name/comment and encoding of the orginal zip entry.
Method Summary
byte[]getCentralDirectoryData()
ZipShortgetCentralDirectoryLength()
byte[]getLocalFileDataData()
ZipShortgetLocalFileDataLength()
longgetNameCRC32()
byte[]getUnicodeName()
voidparseFromLocalFileData(byte[] buffer, int offset, int length)
voidsetNameCRC32(long nameCRC32)
voidsetUnicodeName(byte[] unicodeName)

Constructor Detail

AbstractUnicodeExtraField

protected AbstractUnicodeExtraField()

AbstractUnicodeExtraField

protected AbstractUnicodeExtraField(String text, byte[] bytes, int off, int len)
Assemble as unicode extension from the name/comment and encoding of the orginal zip entry.

Parameters: text The file name or comment. bytes The encoded of the filename or comment in the zip file. off The offset of the encoded filename or comment in bytes. len The length of the encoded filename or commentin bytes.

AbstractUnicodeExtraField

protected AbstractUnicodeExtraField(String text, byte[] bytes)
Assemble as unicode extension from the name/comment and encoding of the orginal zip entry.

Parameters: text The file name or comment. bytes The encoded of the filename or comment in the zip file.

Method Detail

getCentralDirectoryData

public byte[] getCentralDirectoryData()

getCentralDirectoryLength

public ZipShort getCentralDirectoryLength()

getLocalFileDataData

public byte[] getLocalFileDataData()

getLocalFileDataLength

public ZipShort getLocalFileDataLength()

getNameCRC32

public long getNameCRC32()

Returns: The CRC32 checksum of the filename or comment as encoded in the central directory of the zip file.

getUnicodeName

public byte[] getUnicodeName()

Returns: The utf-8 encoded name.

parseFromLocalFileData

public void parseFromLocalFileData(byte[] buffer, int offset, int length)

setNameCRC32

public void setNameCRC32(long nameCRC32)

Parameters: nameCRC32 The CRC32 checksum of the filename as encoded in the central directory of the zip file to set.

setUnicodeName

public void setUnicodeName(byte[] unicodeName)

Parameters: unicodeName The utf-8 encoded name to set.