final class DefaultExtraField extends ExtraField
This class is not thread-safe.
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
data |
private int |
headerID |
ZIP64_HEADER_ID| Constructor and Description |
|---|
DefaultExtraField(int headerID)
Creates a new instance of the default Extra Field implementation.
|
| Modifier and Type | Method and Description |
|---|---|
(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. |
create, getDataBlock, registerDefaultExtraField(int headerID)
headerID - An unsigned short integer (two bytes) indicating the
type of the Extra Field.IllegalArgumentException - Ifpublic int getHeaderID()
ExtraFieldgetHeaderID 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()Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.