|
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.ExtraFields
final class ExtraFields
Represents a collection of Extra Fields as they may
be present at several locations in ZIP archive files.
This class is not thread-safe.
| Field Summary | |
|---|---|
private Map |
extra
The map of Extra Fields. |
| Constructor Summary | |
|---|---|
ExtraFields()
|
|
| Method Summary | |
|---|---|
Object |
clone()
Returns a shallow clone of this collection. |
ExtraField |
get(int headerID)
Returns the Extra Field with the given Header ID or null
if no such Extra Field exists. |
(package private) byte[] |
getExtra()
Returns a protective copy of the Extra Fields. |
(package private) int |
getExtraLength()
Returns the number of bytes required to hold the Extra Fields. |
ExtraField |
put(ExtraField ef)
Stores the given Extra Field in this collection. |
(package private) void |
readFrom(byte[] data,
int off,
int size)
Initializes this collection by deserializing a list of Extra Fields of size bytes from the
byte array data at the zero based offset off. |
ExtraField |
remove(int headerID)
Removes the Extra Field with the given Header ID. |
int |
size()
Returns the number of Extra Fields in this collection. |
(package private) void |
writeTo(byte[] data,
int off)
Serializes a list of Extra Fields of getExtraLength() bytes to the
byte array data at the zero based offset off. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Map extra
Integer] to Extra Field [ExtraField].
Must not be null, but may be empty if no Extra Fields are used.
The map is sorted by Header IDs in ascending order.
| Constructor Detail |
|---|
ExtraFields()
| Method Detail |
|---|
public Object clone()
clone in class Objectpublic int size()
public ExtraField get(int headerID)
null
if no such Extra Field exists.
headerID - The requested Header ID.
null
if no such Extra Field exists.
IllegalArgumentException - If headerID is not in
the range of 0 to UShort.MAX_VALUE
(65535).public ExtraField put(ExtraField ef)
ef - The Extra Field to store in this collection.
null if no such
Extra Field existed.
NullPointerException - If ef is null.
IllegalArgumentException - If the Header ID of the given Extra
Field is not in the range of 0 to
UShort.MAX_VALUE
(65535).public ExtraField remove(int headerID)
headerID - The requested Header ID.
null
if no such Extra Field exists.
IllegalArgumentException - If headerID is not in
the range of 0 to UShort.MAX_VALUE
(65535).int getExtraLength()
0.getExtra()byte[] getExtra()
null is never returned.
getExtraLength()
void readFrom(byte[] data,
int off,
int size)
size bytes from the
byte array data at the zero based offset off.
Upon return, this collection shall not access data
subsequently and getExtraLength() must equal size.
data - The byte array to read the list of Extra Fields from.off - The zero based offset in the byte array where the first byte
of the list of Extra Fields is read from.size - The length of the list of Extra Fields in bytes.
IndexOutOfBoundsException - If the byte array
data does not hold at least size
bytes at the zero based offset off.
RuntimeException - If size is illegal or the
deserialized list of Extra Fields contains illegal data.getExtraLength()
void writeTo(byte[] data,
int off)
getExtraLength() bytes to the
byte array data at the zero based offset off.
Upon return, this collection shall not access data
subsequently.
data - The byte array to write the list of Extra Fields to.off - The zero based offset in the byte array where the first byte
of the list of Extra Fields is written to.
IndexOutOfBoundsException - If the byte array
data does not hold at least getExtraLength()
bytes at the zero based offset off.getExtraLength()
|
TrueZIP 6.8.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||