|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jguild.jrpm.io.Header
This class represents the abstract definition of a header structur. It can be either a signature or a header. The tags of such a structure can be accessed by either their tag id or by their tag name. Also all available and all read tag names in this structure can be accessed.
Field Summary | |
protected long |
size
The size in bytes of this structure |
Constructor Summary | |
Header(java.io.DataInputStream inputStream)
Construct a header structure for the given input stream. |
|
Header(java.io.DataInputStream inputStream,
boolean rawHeader)
Create a header structure from an input stream. |
Method Summary | |
static java.lang.String[] |
getKnownTagNames()
Read all known tag names for this header structure. |
long |
getSize()
Get the size in bytes of this structure |
DataTypeIf |
getTag(long tag)
Get a tag by id as a long |
DataTypeIf |
getTag(java.lang.Long tag)
Get a tag by id as a Long |
DataTypeIf |
getTag(java.lang.String tagname)
Get a tag by name |
abstract long |
getTagIdForName(java.lang.String tagname)
Read a tag with a given tag name. |
long[] |
getTagIds()
Get all tag ids contained in this rpm file. |
abstract java.lang.String |
getTagNameForId(long tagid)
Read a tag with a given tag id. |
java.lang.String[] |
getTagNames()
Get all tag names contained in this rpm file. |
abstract boolean |
isValidTag(long tagid)
Test if the given tagid is associated with a valid tag |
abstract boolean |
isValidTag(java.lang.String tagname)
Test if the given tagname is associated with a valid tag |
void |
setTag(long tag,
DataTypeIf data)
Set a tag by id as a long |
void |
setTag(java.lang.Long tag,
DataTypeIf data)
Set a tag by id as a Long |
void |
setTag(java.lang.String tagname,
DataTypeIf data)
Set a tag by id as a string |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected long size
Constructor Detail |
public Header(java.io.DataInputStream inputStream, boolean rawHeader) throws java.io.IOException
byte magic[3]; (3 byte) (8e ad e8)
int version; (1 byte)
byte reserved[4]; (4 byte)
long num_index; (4 byte)
long num_data; (4 byte)
Afterwards the index entries are read and then the tags and the
correspondig data entries are read.
inputStream
- An inputstream containing rpm file informationsrawHeader
- Are we a raw header (from headerUnload or rpmdb)
java.io.IOException
- if an error occurs on reading informations
out of the streampublic Header(java.io.DataInputStream inputStream) throws java.io.IOException
inputStream
-
java.io.IOException
Method Detail |
public static java.lang.String[] getKnownTagNames()
public long getSize()
public DataTypeIf getTag(java.lang.Long tag)
tag
- A tag id as a Long
public DataTypeIf getTag(long tag)
tag
- A tag id as a long
public DataTypeIf getTag(java.lang.String tagname)
tagname
- A tag name
public void setTag(java.lang.Long tag, DataTypeIf data)
tag
- A tag id as a Longdata
- A data struct containing the data of this tagpublic void setTag(long tag, DataTypeIf data)
tag
- A tag id as a longdata
- A data struct containing the data of this tagpublic void setTag(java.lang.String tagname, DataTypeIf data)
tagname
- A tag id as a stringdata
- A data struct containing the data of this tagpublic long[] getTagIds()
public java.lang.String[] getTagNames()
public abstract long getTagIdForName(java.lang.String tagname)
tagname
- A RPM tag name
java.lang.IllegalArgumentException
- if the tag name was not foundpublic abstract java.lang.String getTagNameForId(long tagid)
tagid
- A RPM tag id
java.lang.IllegalArgumentException
- if the tag id was not foundpublic abstract boolean isValidTag(long tagid)
tagid
- The id of a tag
public abstract boolean isValidTag(java.lang.String tagname)
tagname
- The name of a tag
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |