org.apache.tools.zip

Class UnicodeCommentExtraField

public class UnicodeCommentExtraField extends AbstractUnicodeExtraField

Info-ZIP Unicode Comment Extra Field (0x6375):

Stores the UTF-8 version of the file comment as stored in the central directory header.

         Value         Size        Description
         -----         ----        -----------
  (UCom) 0x6375        Short       tag for this extra block type ("uc")
         TSize         Short       total data size for this block
         Version       1 byte      version of this extra field, currently 1
         ComCRC32      4 bytes     Comment Field CRC32 Checksum
         UnicodeCom    Variable    UTF-8 version of the entry comment
 
Field Summary
static ZipShortUCOM_ID
Constructor Summary
UnicodeCommentExtraField()
UnicodeCommentExtraField(String text, byte[] bytes, int off, int len)
Assemble as unicode comment extension from the name given as text as well as the encoded bytes actually written to the archive.
UnicodeCommentExtraField(String comment, byte[] bytes)
Assemble as unicode comment extension from the comment given as text as well as the bytes actually written to the archive.
Method Summary
ZipShortgetHeaderId()

Field Detail

UCOM_ID

public static final ZipShort UCOM_ID

Constructor Detail

UnicodeCommentExtraField

public UnicodeCommentExtraField()

UnicodeCommentExtraField

public UnicodeCommentExtraField(String text, byte[] bytes, int off, int len)
Assemble as unicode comment extension from the name given as text as well as the encoded bytes actually written to the archive.

Parameters: text The file name bytes the bytes actually written to the archive off The offset of the encoded comment in bytes. len The length of the encoded comment or comment in bytes.

UnicodeCommentExtraField

public UnicodeCommentExtraField(String comment, byte[] bytes)
Assemble as unicode comment extension from the comment given as text as well as the bytes actually written to the archive.

Parameters: comment The file comment bytes the bytes actually written to the archive

Method Detail

getHeaderId

public ZipShort getHeaderId()