|
TrueZIP 6.8.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.util.zip.ExtraField
de.schlichtherle.util.zip.DefaultExtraField
final class DefaultExtraField
Default implementation for an Extra Field in a Local or Central Header of a ZIP archive.
This class is not thread-safe.
| Field Summary | |
|---|---|
private byte[] |
data
|
private int |
headerID
|
| Fields inherited from class de.schlichtherle.util.zip.ExtraField |
|---|
ZIP64_HEADER_ID |
| Constructor Summary | |
|---|---|
DefaultExtraField(int headerID)
Creates a new instance of the default Extra Field implementation. |
|
| Method Summary | |
|---|---|
(package private) int |
getDataSize()
Returns the Data Size of this Extra Field. |
int |
getHeaderID()
Returns the Header ID (type) of this Extra Field. |
(package private) void |
readFrom(byte[] data,
int off,
int size)
Initializes this Extra Field by deserializing a Data Block of size bytes from the
byte array data at the zero based offset off. |
(package private) void |
writeTo(byte[] data,
int off)
Serializes a Data Block of ExtraField.getDataSize() bytes to the
byte array data at the zero based offset off. |
| Methods inherited from class de.schlichtherle.util.zip.ExtraField |
|---|
create, getDataBlock, register |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final int headerID
private byte[] data
| Constructor Detail |
|---|
DefaultExtraField(int headerID)
headerID - An unsigned short integer (two bytes) indicating the
type of the Extra Field.
IllegalArgumentException - If| Method Detail |
|---|
public int getHeaderID()
ExtraField
getHeaderID in class ExtraFieldint getDataSize()
ExtraFieldExtraField.readFrom(byte[], int, int).
getDataSize in class ExtraField0 if unknown.ExtraField.getDataBlock()
void readFrom(byte[] data,
int off,
int size)
ExtraFieldsize bytes from the
byte array data at the zero based offset off.
Upon return, this Extra Field shall not access data
subsequently and ExtraField.getDataSize() must equal size.
readFrom in class ExtraFielddata - The byte array to read the Data Block from.off - The zero based offset in the byte array where the first byte
of the Data Block is read from.size - The length of the Data Block in bytes.ExtraField.getDataSize()
void writeTo(byte[] data,
int off)
ExtraFieldExtraField.getDataSize() bytes to the
byte array data at the zero based offset off.
Upon return, this Extra Field shall not access data
subsequently.
writeTo in class ExtraFielddata - The byte array to write the Data Block to.off - The zero based offset in the byte array where the first byte
of the Data Block is written to.ExtraField.getDataSize()
|
TrueZIP 6.8.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||