SF.net SVN: jrpm: [21] trunk/src

[email protected] Wed, 18 Jun 2008 17:35:48 -0700
Newsgroups gmane.comp.java.jrpm.devel
Message-ID <[email protected]>
Revision: 21
          http://jrpm.svn.sourceforge.net/jrpm/?rev=21&view=rev
Author:   mkuss
Date:     2008-06-18 17:35:46 -0700 (Wed, 18 Jun 2008)

Log Message:
-----------
do some fixes and rework to get better RPM5 support

Modified Paths:
--------------
    trunk/src/java/com/jguild/jrpm/io/Header.java
    trunk/src/java/com/jguild/jrpm/io/RPMFile.java
    trunk/src/java/com/jguild/jrpm/io/RPMHeader.java
    trunk/src/java/com/jguild/jrpm/io/RPMSignature.java
    trunk/src/java/com/jguild/jrpm/io/constant/EnumDelegate.java
    trunk/src/java/com/jguild/jrpm/io/constant/RPMHeaderTag.java
    trunk/src/java/com/jguild/jrpm/tools/Info.java
    trunk/src/test/com/jguild/jrpm/test/HeaderFileParsingTest.java
    trunk/src/test/com/jguild/jrpm/test/RPMFileParsingTest.java

Added Paths:
-----------
    trunk/src/java/com/jguild/jrpm/io/Store.java

Removed Paths:
-------------
    trunk/src/java/com/jguild/jrpm/io/constant/RPMSignatureTag.java

Modified: trunk/src/java/com/jguild/jrpm/io/Header.java
===================================================================
--- trunk/src/java/com/jguild/jrpm/io/Header.java	2008-04-20 17:14:01 UTC (rev 20)
+++ trunk/src/java/com/jguild/jrpm/io/Header.java	2008-06-19 00:35:46 UTC (rev 21)
@@ -7,344 +7,222 @@
 import java.io.DataInputStream;
 import java.io.IOException;
 import java.util.Comparator;
-import java.util.HashMap;
 import java.util.TreeSet;
-
-import java.util.logging.Logger;
 import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import com.jguild.jrpm.io.datatype.DataTypeIf;
 import com.jguild.jrpm.io.datatype.TypeFactory;
 
 /**
- * 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.
- *
+ * 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.
+ * 
  * @author kuss
  * @version $Id: Header.java,v 1.10 2004/09/09 09:52:33 pnasrat Exp $
  */
 public abstract class Header {
     private static final int HEADER_LENGTH = 16;
+
     private static final Logger logger = RPMFile.logger;
-    private HashMap store = new HashMap();
+
     private IndexEntry[] indexes;
+
     private int version;
+
     private long indexDataSize;
+
     private long indexNumber;
-    private boolean rawHeader = false;
+
+    private Store store;
+
     /**
-     * The size in bytes of this structure.
-     */
+         * The size in bytes of this structure.
+         */
     protected long size;
 
     /**
-     * Create a header structure from an input stream.
-     * <p/>
-     * The header structure of a signature or a header can be read and
-     * also the index entries containing the tags for this rpm section
-     * (signature or header).
-     * <p/>
-     * Unless we have a raw header from headerUnload or the database,
-     * a header is read consisting of the following fields:
-     * <code><pre>
-     * 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)
-     * </pre></code>
-     * <p/>
-     * Afterwards the index entries are read and then the tags and the
-     * correspondig data entries are read.
-     *
-     * @param inputStream An inputstream containing rpm file informations
-     * @param rawHeader   Are we a raw header (from headerUnload or rpmdb)
-     * @throws IOException if an error occurs on reading informations
-     *                     out of the stream
-     */
-    public Header(DataInputStream inputStream, boolean rawHeader) throws IOException {
-        if (logger.isLoggable(Level.FINER)) {
-            logger.finer("Start Reading Header");
-        }
+         * Create a header structure from an input stream. <p/> The header
+         * structure of a signature or a header can be read and also the index
+         * entries containing the tags for this rpm section (signature or
+         * header). <p/> Unless we have a raw header from headerUnload or the
+         * database, a header is read consisting of the following fields:
+         * <code><pre>
+         * 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)
+         * </pre></code> <p/> Afterwards the index entries are read and then the tags
+         * and the correspondig data entries are read.
+         * 
+         * @param inputStream
+         *                An inputstream containing rpm file informations
+         * @param rawHeader
+         *                Are we a raw header (from headerUnload or rpmdb)
+         * @throws IOException
+         *                 if an error occurs on reading informations out of the
+         *                 stream
+         */
+    public Header(DataInputStream inputStream, boolean rawHeader, Store store)
+	    throws IOException {
+	this.store = store;
 
-        if (!rawHeader) {
-            // Read header
-            size = HEADER_LENGTH;
+	if (logger.isLoggable(Level.FINER)) {
+	    logger.finer("Start Reading Header");
+	}
 
-            int magic = 0;
-            
-            do {
-               magic = inputStream.readUnsignedByte();
-               if (magic == 0)
-                  inputStream.skip(7);
-            } while(magic == 0);
-            
-            check(magic == 0x8E, "Header magic 0x"+ Integer.toHexString(magic) + " != 0x8E");
-            magic =inputStream.readUnsignedByte();  
-            check(magic == 0xAD, "Header magic 0x"+ Integer.toHexString(magic) + " != 0xAD");
-            magic =inputStream.readUnsignedByte();  
-            check(magic == 0xE8, "Header magic 0x"+ Integer.toHexString(magic) + " != 0xE8");
-            version = inputStream.readUnsignedByte();
+	if (!rawHeader) {
+	    // Read header
+	    size = HEADER_LENGTH;
 
-            if (logger.isLoggable(Level.FINER)) {
-                logger.finer("version: " + version);
-            }
+	    int magic = 0;
 
-            // skip reserved bytes
-            inputStream.skipBytes(4);
-        }
+	    do {
+		magic = inputStream.readUnsignedByte();
+		if (magic == 0)
+		    inputStream.skip(7);
+	    } while (magic == 0);
 
-        indexNumber = inputStream.readInt();
+	    check(magic == 0x8E, "Header magic 0x" + Integer.toHexString(magic)
+		    + " != 0x8E");
+	    magic = inputStream.readUnsignedByte();
+	    check(magic == 0xAD, "Header magic 0x" + Integer.toHexString(magic)
+		    + " != 0xAD");
+	    magic = inputStream.readUnsignedByte();
+	    check(magic == 0xE8, "Header magic 0x" + Integer.toHexString(magic)
+		    + " != 0xE8");
+	    version = inputStream.readUnsignedByte();
 
-        if (logger.isLoggable(Level.FINER)) {
-            logger.finer("indexes available: " + indexNumber);
-        }
+	    if (logger.isLoggable(Level.FINER)) {
+		logger.finer("version: " + version);
+	    }
 
-        indexDataSize = inputStream.readInt();
+	    // skip reserved bytes
+	    inputStream.skipBytes(4);
+	}
 
-        if (logger.isLoggable(Level.FINER)) {
-            logger.finer("index data size: " + indexDataSize);
-        }
+	indexNumber = inputStream.readInt();
 
-        // Read indexes
-        // make sure to sort them in order of offset to
-        // be able to read the store without jumping arround in
-        // the file
-        TreeSet _indexes = new TreeSet(new Comparator() {
-            public int compare(Object o1, Object o2) {
-                return (int) (((IndexEntry) o1).getOffset() - ((IndexEntry) o2).getOffset());
-            }
+	if (logger.isLoggable(Level.FINER)) {
+	    logger.finer("indexes available: " + indexNumber);
+	}
 
-            public boolean equals(Object o) {
-                return false;
-            }
-        });
+	indexDataSize = inputStream.readInt();
 
-        for (int i = 0; i < indexNumber; i++) {
-            IndexEntry index = new IndexEntry(inputStream);
+	if (logger.isLoggable(Level.FINER)) {
+	    logger.finer("index data size: " + indexDataSize);
+	}
 
-            _indexes.add(index);
-            size += index.getSize();
-        }
+	// Read indexes
+	// make sure to sort them in order of offset to
+	// be able to read the store without jumping arround in
+	// the file
+	TreeSet _indexes = new TreeSet(new Comparator() {
+	    public int compare(Object o1, Object o2) {
+		return (int) (((IndexEntry) o1).getOffset() - ((IndexEntry) o2)
+			.getOffset());
+	    }
 
-        indexes = new IndexEntry[0];
-        indexes = (IndexEntry[]) _indexes.toArray(indexes);
+	    public boolean equals(Object o) {
+		return false;
+	    }
+	});
 
-        // Read store
-        for (int i = 0; i < indexes.length; i++) {
-            IndexEntry index = indexes[i];
+	for (int i = 0; i < indexNumber; i++) {
+	    IndexEntry index = new IndexEntry(inputStream);
 
-            //            if (index.getType().equals(RPMIndexType.STRING_ARRAY) || index.getType().equals(RPMIndexType.STRING) ||
-            //                    index.getType().equals(RPMIndexType.I18NSTRING)) {
-            //                if (i < (indexes.length - 1)) {
-            //                    IndexEntry next = indexes[i + 1];
-            //
-            //                    length = next.getOffset() - index.getOffset();
-            //                } else {
-            //                    length = indexDataSize - index.getOffset();
-            //                }
-            //
-            //                // and initialize temporary space for data
-            //                stringData = new byte[(int) length];
-            //
-            //                // and read it from stream
-            //                inputStream.readFully(stringData);
-            //            }
-            DataTypeIf dataObject = null;
+	    _indexes.add(index);
+	    size += index.getSize();
+	}
 
-            if (logger.isLoggable(Level.FINER)) {
-                logger.finer("Reading for tag '" + getTagNameForId(index.getTag()) + "' '" + index.getCount() + "' entries of type '" +
-                        index.getType().getName() + "'");
-            }
+	indexes = new IndexEntry[0];
+	indexes = (IndexEntry[]) _indexes.toArray(indexes);
 
-            dataObject = TypeFactory.createFromStream(inputStream, index,
-                    (i < (indexes.length - 1)) ? (indexes[i + 1].getOffset() - index.getOffset()) : (indexDataSize - index.getOffset()));
+	// Read store
+	for (int i = 0; i < indexes.length; i++) {
+	    IndexEntry index = indexes[i];
 
-            // adjust size
-            size += dataObject.getSize();
+	    // if (index.getType().equals(RPMIndexType.STRING_ARRAY) ||
+	    // index.getType().equals(RPMIndexType.STRING) ||
+	    // index.getType().equals(RPMIndexType.I18NSTRING)) {
+	    // if (i < (indexes.length - 1)) {
+	    // IndexEntry next = indexes[i + 1];
+	    //
+	    // length = next.getOffset() - index.getOffset();
+	    // } else {
+	    // length = indexDataSize - index.getOffset();
+	    // }
+	    //
+	    // // and initialize temporary space for data
+	    // stringData = new byte[(int) length];
+	    //
+	    // // and read it from stream
+	    // inputStream.readFully(stringData);
+	    // }
+	    DataTypeIf dataObject = null;
 
-            store.put(new Long(index.getTag()), dataObject);
-        }
+	    if (logger.isLoggable(Level.FINER)) {
+		logger.finer("Reading for tag '"
+			+ store.getTagNameForId(index.getTag()) + "' '"
+			+ index.getCount() + "' entries of type '"
+			+ index.getType().getName() + "'");
+	    }
 
-        if (logger.isLoggable(Level.FINER)) {
-            logger.finer("");
-        }
+	    dataObject = TypeFactory
+		    .createFromStream(inputStream, index,
+			    (i < (indexes.length - 1)) ? (indexes[i + 1]
+				    .getOffset() - index.getOffset())
+				    : (indexDataSize - index.getOffset()));
 
-        if (logger.isLoggable(Level.FINER)) {
-            logger.finer("Finished Reading Header");
-        }
-    }
+	    // adjust size
+	    size += dataObject.getSize();
 
-    /**
-     * Construct a header structure for the given input stream.
-     *
-     * @param inputStream
-     * @throws IOException
-     */
-    public Header(DataInputStream inputStream) throws IOException {
-        this(inputStream, false);
-    }
+	    store.setTag(index.getTag(), dataObject);
+	}
 
-    /**
-     * Read all known tag names for this header structure.
-     *
-     * @return An array of tag names
-     */
-    public static String[] getKnownTagNames() {
-        return new String[0];
-    }
+	if (logger.isLoggable(Level.FINER)) {
+	    logger.finer("");
+	}
 
-    /**
-     * Get the size in bytes of this structure
-     *
-     * @return The size in bytes.
-     */
-    public long getSize() {
-        return size;
+	if (logger.isLoggable(Level.FINER)) {
+	    logger.finer("Finished Reading Header");
+	}
     }
 
     /**
-     * Get a tag by id as a Long
-     *
-     * @param tag A tag id as a Long
-     * @return A data struct containing the data of this tag
-     */
-    public DataTypeIf getTag(Long tag) {
-        return (DataTypeIf) store.get(tag);
+         * Construct a header structure for the given input stream.
+         * 
+         * @param inputStream
+         * @throws IOException
+         */
+    public Header(DataInputStream inputStream, Store store) throws IOException {
+	this(inputStream, false, store);
     }
 
     /**
-     * Get a tag by id as a long
-     *
-     * @param tag A tag id as a long
-     * @return A data struct containing the data of this tag
-     */
-    public DataTypeIf getTag(long tag) {
-        return getTag(new Long(tag));
+         * Get the size in bytes of this structure
+         * 
+         * @return The size in bytes.
+         */
+    public long getSize() {
+	return size;
     }
 
     /**
-     * Get a tag by name
-     *
-     * @param tagname A tag name
-     * @return A data struct containing the data of this tag
-     */
-    public DataTypeIf getTag(String tagname) {
-        return getTag(getTagIdForName(tagname));
-    }
-
-    /**
-     * Set a tag by id as a Long
-     *
-     * @param tag  A tag id as a Long
-     * @param data A data struct containing the data of this tag
-     */
-    public void setTag(Long tag, DataTypeIf data) {
-        isValidTag(tag.longValue());
-        store.put(tag, data);
-    }
-
-    /**
-     * Set a tag by id as a long
-     *
-     * @param tag  A tag id as a long
-     * @param data A data struct containing the data of this tag
-     */
-    public void setTag(long tag, DataTypeIf data) {
-        setTag(new Long(tag), data);
-    }
-
-    /**
-     * Set a tag by id as a string
-     *
-     * @param tagname A tag id as a string
-     * @param data    A data struct containing the data of this tag
-     */
-    public void setTag(String tagname, DataTypeIf data) {
-        setTag(getTagIdForName(tagname), data);
-    }
-
-    /**
-     * Get all tag ids contained in this rpm file.
-     *
-     * @return All tag ids contained in this rpm file.
-     */
-    public long[] getTagIds() {
-        Long[] tmp = (Long[]) store.keySet().toArray(new Long[0]);
-        long[] ret = new long[tmp.length];
-
-        for (int i = 0; i < tmp.length; i++) {
-            ret[i] = tmp[i].longValue();
-        }
-
-        return ret;
-    }
-
-    /**
-     * Get all tag names contained in this rpm file.
-     *
-     * @return All tag names contained in this rpm file.
-     */
-    public String[] getTagNames() {
-        Long[] tmp = (Long[]) store.keySet().toArray(new Long[0]);
-        String[] ret = new String[tmp.length];
-
-        for (int i = 0; i < tmp.length; i++) {
-            ret[i] = getTagNameForId(tmp[i].longValue());
-        }
-
-        return ret;
-    }
-
-    /**
-     * Asserts a boolean value and throws an exception if it
-     * is false
-     *
-     * @param test A boolean test variable
-     * @throws IOException if the variable test is false
-     */
+         * Asserts a boolean value and throws an exception if it is false
+         * 
+         * @param test
+         *                A boolean test variable
+         * @throws IOException
+         *                 if the variable test is false
+         */
     private static final void check(boolean test, String message)
-            throws IOException {
-        if (!test) {
-            throw new IOException("Corrupted archive: " + message);
-        }
+	    throws IOException {
+	if (!test) {
+	    throw new IOException("Corrupted archive: " + message);
+	}
     }
-
-    /**
-     * Read a tag with a given tag name. The tag will be read out of the
-     * class defined in getTagEnum().
-     *
-     * @param tagname A RPM tag name
-     * @return The id of the RPM tag
-     * @throws IllegalArgumentException if the tag name was not found
-     */
-    public abstract long getTagIdForName(String tagname);
-
-    /**
-     * Read a tag with a given tag id. The tag will be read out of the
-     * class defined in getTagEnum().
-     *
-     * @param tagid A RPM tag id
-     * @return The name of the RPM tag
-     * @throws IllegalArgumentException if the tag id was not found
-     */
-    public abstract String getTagNameForId(long tagid);
-
-    /**
-     * Test if the given tagid is associated with a valid tag
-     *
-     * @param tagid The id of a tag
-     * @return TRUE if the tagid is valid
-     */
-    public abstract boolean isValidTag(long tagid);
-
-    /**
-     * Test if the given tagname is associated with a valid tag
-     *
-     * @param tagname The name of a tag
-     * @return TRUE if the tagname is valid
-     */
-    public abstract boolean isValidTag(String tagname);
 }

Modified: trunk/src/java/com/jguild/jrpm/io/RPMFile.java
===================================================================
--- trunk/src/java/com/jguild/jrpm/io/RPMFile.java	2008-04-20 17:14:01 UTC (rev 20)
+++ trunk/src/java/com/jguild/jrpm/io/RPMFile.java	2008-06-19 00:35:46 UTC (rev 21)
@@ -39,6 +39,7 @@
 import com.jguild.jrpm.io.cpio.CPIOInputStream;
 import com.jguild.jrpm.io.datatype.DataTypeIf;
 import com.jguild.jrpm.io.datatype.I18NSTRING;
+import com.jguild.jrpm.io.datatype.INT32;
 import com.jguild.jrpm.io.datatype.STRING_ARRAY;
 import com.jguild.jrpm.io.datatype.TypeFactory;
 
@@ -48,523 +49,542 @@
  * @todo Implement equals()
  */
 public class RPMFile {
-	public static final Logger logger = Logger.getLogger("jrpm.io");
+    public static final Logger logger = Logger.getLogger("jrpm.io");
 
-	private RPMHeader header = null;
+    private Header header = null;
 
-	private RPMLead lead = null;
+    private RPMLead lead = null;
 
-	private RPMSignature signature = null;
+    private Header signature = null;
 
-	private int localePosition;
+    private int localePosition;
 
-	private File rpmFile = null;
+    private File rpmFile = null;
 
-	private boolean editingRpmFile = false;
+    private boolean editingRpmFile = false;
 
-	/**
-	 * Creates a new empty RPMFile object.
-	 */
-	public RPMFile() {
-	}
+    private Store store = new Store();
 
-	/**
-	 * Creates a new RPMFile object out of a file.
-	 * 
-	 * @param fh
-	 *            The file object representing a rpm file
-	 */
-	public RPMFile(File fh) {
-		rpmFile = fh;
-	}
+    /**
+         * Creates a new empty RPMFile object.
+         */
+    public RPMFile() {
+    }
 
-	private synchronized void reset() {
-		header = null;
-		lead = null;
-		signature = null;
-		editingRpmFile = false;
-	}
+    /**
+         * Creates a new RPMFile object out of a file.
+         * 
+         * @param fh
+         *                The file object representing a rpm file
+         */
+    public RPMFile(File fh) {
+	rpmFile = fh;
+    }
 
-	/**
-	 * Set the file this RPMFile should represent
-	 * 
-	 * @param fh
-	 *            The file object representing a rpm file
-	 */
-	public synchronized void setFile(File fh) {
-		if (editingRpmFile) {
-			throw new IllegalStateException("RPM file is currently edited");
-		}
-		rpmFile = fh;
-		reset();
+    private synchronized void reset() {
+	header = null;
+	lead = null;
+	signature = null;
+	editingRpmFile = false;
+    }
+
+    /**
+         * Set the file this RPMFile should represent
+         * 
+         * @param fh
+         *                The file object representing a rpm file
+         */
+    public synchronized void setFile(File fh) {
+	if (editingRpmFile) {
+	    throw new IllegalStateException("RPM file is currently edited");
 	}
+	rpmFile = fh;
+	reset();
+    }
 
-	/**
-	 * Parse the RPMFile and will extract all informations. This must be called
-	 * before any informations can be read from the rpm file.
-	 * 
-	 * @throws IOException
-	 *             If an error occurs during read of the rpm file
-	 */
-	public synchronized void parse() throws IOException {
-		if (rpmFile == null)
-			throw new IllegalStateException("A file must be specified");
+    /**
+         * Parse the RPMFile and will extract all informations. This must be
+         * called before any informations can be read from the rpm file.
+         * 
+         * @throws IOException
+         *                 If an error occurs during read of the rpm file
+         */
+    public synchronized void parse() throws IOException {
+	if (rpmFile == null)
+	    throw new IllegalStateException("A file must be specified");
 
-		if (!rpmFile.exists())
-			throw new IllegalStateException("The specified file does not exist");
+	if (!rpmFile.exists())
+	    throw new IllegalStateException("The specified file does not exist");
 
-		try {
-			readFromStream(new BufferedInputStream(
-					new FileInputStream(rpmFile), 4096));
-		} catch (IOException e) {
-			reset();
-			throw e;
-		}
-		editingRpmFile = true;
+	try {
+	    readFromStream(new BufferedInputStream(
+		    new FileInputStream(rpmFile), 4096));
+	} catch (IOException e) {
+	    reset();
+	    throw e;
 	}
+	editingRpmFile = true;
+    }
 
-	/**
-	 * Get the header section of this rpm file.
-	 * 
-	 * @return The rpm header
-	 */
-	public synchronized RPMHeader getHeader() {
-		if (header == null)
-			throw new IllegalStateException("There are no header informations");
+    /**
+         * Get the header section of this rpm file.
+         * 
+         * @return The rpm header
+         */
+    public synchronized Header getHeader() {
+	if (header == null)
+	    throw new IllegalStateException("There are no header informations");
 
-		return header;
-	}
+	return header;
+    }
 
-	/**
-	 * Get all known tags of this rpm file. This is equivalent to the
-	 * --querytags option in rpm.
-	 * 
-	 * @return An array of all tag names
-	 */
-	public static String[] getKnownTagNames() {
-		return Header.getKnownTagNames();
-	}
+    /**
+         * Get all known tags of this rpm file. This is equivalent to the
+         * --querytags option in rpm.
+         * 
+         * @return An array of all tag names
+         */
+    public static String[] getKnownTagNames() {
+	return Store.getKnownTagNames();
+    }
 
-	/**
-	 * Get the lead section of this rpm file
-	 * 
-	 * @return The rpm lead
-	 */
-	public synchronized RPMLead getLead() {
-		if (lead == null)
-			throw new IllegalStateException("There are no lead informations");
+    /**
+         * Get the lead section of this rpm file
+         * 
+         * @return The rpm lead
+         */
+    public synchronized RPMLead getLead() {
+	if (lead == null)
+	    throw new IllegalStateException("There are no lead informations");
 
-		return lead;
-	}
+	return lead;
+    }
 
-	/**
-	 * Set the locale as int for all I18N strings that are returned by getTag().
-	 * The position has to correspond with the same position in the array
-	 * returned by getLocales().
-	 * 
-	 * @param pos
-	 *            The position in the array returned by getLocales().
-	 */
-	public synchronized void setLocale(int pos) {
-		localePosition = pos;
+    /**
+         * Set the locale as int for all I18N strings that are returned by
+         * getTag(). The position has to correspond with the same position in
+         * the array returned by getLocales().
+         * 
+         * @param pos
+         *                The position in the array returned by getLocales().
+         */
+    public synchronized void setLocale(int pos) {
+	localePosition = pos;
+    }
+
+    /**
+         * Set the locale as string for all I18N strings that are returned by
+         * getTag(). The string must match with a string returned by
+         * getLocales().
+         * 
+         * @param locale
+         *                A locale matching a locale returned by getLocales()
+         * @throws IllegalArgumentException
+         *                 If the locale is not defined by getLocales().
+         */
+    public synchronized void setLocale(String locale) {
+	String[] locales = ((STRING_ARRAY) getTag("HEADERI18NTABLE")).getData();
+
+	for (int pos = 0; pos < locales.length; pos++) {
+	    if (locales[pos].equals(locale)) {
+		setLocale(pos);
+
+		return;
+	    }
 	}
 
-	/**
-	 * Set the locale as string for all I18N strings that are returned by
-	 * getTag(). The string must match with a string returned by getLocales().
-	 * 
-	 * @param locale
-	 *            A locale matching a locale returned by getLocales()
-	 * @throws IllegalArgumentException
-	 *             If the locale is not defined by getLocales().
-	 */
-	public synchronized void setLocale(String locale) {
-		String[] locales = ((STRING_ARRAY) getTag("HEADERI18NTABLE")).getData();
+	throw new IllegalArgumentException("Unknown locale <" + locale + ">");
+    }
 
-		for (int pos = 0; pos < locales.length; pos++) {
-			if (locales[pos].equals(locale)) {
-				setLocale(pos);
+    /**
+         * Return all known locales that are supported by this RPM file. The
+         * array is read out of the RPM file with the tag "HEADERI18NTABLE". The
+         * RPM has one entry for all I18N strings defined by this tag.
+         * 
+         * @return A string array of all defined locales
+         */
+    public synchronized String[] getLocales() {
+	return ((STRING_ARRAY) getTag("HEADERI18NTABLE")).getData();
+    }
 
-				return;
-			}
-		}
+    /**
+         * Get the signature section of this rpm file
+         * 
+         * @return The rpm signature
+         */
+    public synchronized Header getSignature() {
+	if (signature == null)
+	    throw new IllegalStateException(
+		    "There are no signature informations");
 
-		throw new IllegalArgumentException("Unknown locale <" + locale + ">");
-	}
+	return signature;
+    }
 
-	/**
-	 * Return all known locales that are supported by this RPM file. The array
-	 * is read out of the RPM file with the tag "HEADERI18NTABLE". The RPM has
-	 * one entry for all I18N strings defined by this tag.
-	 * 
-	 * @return A string array of all defined locales
-	 */
-	public synchronized String[] getLocales() {
-		return ((STRING_ARRAY) getTag("HEADERI18NTABLE")).getData();
+    /**
+         * Get a tag by id as a Long
+         * 
+         * @param tag
+         *                A tag id as a Long
+         * @return A data struct containing the data of this tag
+         */
+    public synchronized DataTypeIf getTag(Long tag) {
+	DataTypeIf data = store.getTag(tag);
+
+	// set the locale for all I18N strings
+	if (data instanceof I18NSTRING) {
+	    ((I18NSTRING) data).setLocaleIndex(localePosition);
 	}
 
-	/**
-	 * Get the signature section of this rpm file
-	 * 
-	 * @return The rpm signature
-	 */
-	public synchronized RPMSignature getSignature() {
-		if (signature == null)
-			throw new IllegalStateException(
-					"There are no signature informations");
+	return data;
+    }
 
-		return signature;
-	}
+    /**
+         * Get a tag by id as a long
+         * 
+         * @param tag
+         *                A tag id as a long
+         * @return A data struct containing the data of this tag
+         */
+    public synchronized DataTypeIf getTag(long tag) {
+	return getTag(new Long(tag));
+    }
 
-	/**
-	 * Get a tag by id as a Long
-	 * 
-	 * @param tag
-	 *            A tag id as a Long
-	 * @return A data struct containing the data of this tag
-	 */
-	public synchronized DataTypeIf getTag(Long tag) {
-		DataTypeIf data = getHeader().getTag(tag);
+    /**
+         * Get a tag by name
+         * 
+         * @param tagname
+         *                A tag name
+         * @return A data struct containing the data of this tag
+         */
+    public synchronized DataTypeIf getTag(String tagname) {
+	return getTag(getTagIdForName(tagname));
+    }
 
-		// set the locale for all I18N strings
-		if (data instanceof I18NSTRING) {
-			((I18NSTRING) data).setLocaleIndex(localePosition);
-		}
+    /**
+         * Read a tag with a given tag name.
+         * 
+         * @param tagname
+         *                A RPM tag name
+         * @return The id of the RPM tag
+         * @throws IllegalArgumentException
+         *                 if the tag name was not found
+         * @see Header#getTagIdForName(String)
+         */
+    public synchronized long getTagIdForName(String tagname) {
+	return store.getTagIdForName(tagname);
+    }
 
-		return data;
-	}
+    /**
+         * Get all tag ids contained in this rpm file.
+         * 
+         * @return All tag ids contained in this rpm file.
+         */
+    public synchronized long[] getTagIds() {
+	return store.getTagIds();
+    }
 
-	/**
-	 * Get a tag by id as a long
-	 * 
-	 * @param tag
-	 *            A tag id as a long
-	 * @return A data struct containing the data of this tag
-	 */
-	public synchronized DataTypeIf getTag(long tag) {
-		return getTag(new Long(tag));
-	}
+    /**
+         * Read a tag with a given tag id.
+         * 
+         * @param tagid
+         *                A RPM tag id
+         * @return The name of the RPM tag
+         * @throws IllegalArgumentException
+         *                 if the tag id was not found
+         * @see Header#getTagNameForId(long)
+         */
+    public synchronized String getTagNameForId(long tagid) {
+	return store.getTagNameForId(tagid);
+    }
 
-	/**
-	 * Get a tag by name
-	 * 
-	 * @param tagname
-	 *            A tag name
-	 * @return A data struct containing the data of this tag
-	 */
-	public synchronized DataTypeIf getTag(String tagname) {
-		return getTag(getTagIdForName(tagname));
-	}
+    /**
+         * Get all tag names contained in this rpm file.
+         * 
+         * @return All tag names contained in this rpm file.
+         */
+    public synchronized String[] getTagNames() {
+	return store.getTagNames();
+    }
 
-	/**
-	 * Read a tag with a given tag name.
-	 * 
-	 * @param tagname
-	 *            A RPM tag name
-	 * @return The id of the RPM tag
-	 * @throws IllegalArgumentException
-	 *             if the tag name was not found
-	 * @see Header#getTagIdForName(String)
-	 */
-	public synchronized long getTagIdForName(String tagname) {
-		return getHeader().getTagIdForName(tagname);
-	}
+    /**
+         * Read informations of a rpm file out of an input stream.
+         * 
+         * @param rpmInputStream
+         *                The input stream representing the rpm file
+         * @throws IOException
+         *                 if an error occurs during read of the rpm file
+         */
+    private void readFromStream(InputStream rpmInputStream) throws IOException {
+	ByteCountInputStream allCountInputStream = new ByteCountInputStream(
+		rpmInputStream);
+	InputStream inputStream = new DataInputStream(allCountInputStream);
 
-	/**
-	 * Get all tag ids contained in this rpm file.
-	 * 
-	 * @return All tag ids contained in this rpm file.
-	 */
-	public synchronized long[] getTagIds() {
-		return getHeader().getTagIds();
-	}
+	lead = new RPMLead((DataInputStream) inputStream);
+	signature = new RPMSignature((DataInputStream) inputStream, store);
 
-	/**
-	 * Read a tag with a given tag id.
-	 * 
-	 * @param tagid
-	 *            A RPM tag id
-	 * @return The name of the RPM tag
-	 * @throws IllegalArgumentException
-	 *             if the tag id was not found
-	 * @see Header#getTagNameForId(long)
-	 */
-	public synchronized String getTagNameForId(long tagid) {
-		return getHeader().getTagNameForId(tagid);
+	if (logger.isLoggable(Level.FINER)) {
+	    logger.finer("Signature Size: " + signature.getSize());
 	}
 
-	/**
-	 * Get all tag names contained in this rpm file.
-	 * 
-	 * @return All tag names contained in this rpm file.
-	 */
-	public synchronized String[] getTagNames() {
-		return getHeader().getTagNames();
+	header = new RPMHeader((DataInputStream) inputStream, store);
+
+	if (logger.isLoggable(Level.FINER)) {
+	    logger.finer("Header Size: " + header.getSize());
 	}
 
-	/**
-	 * Read informations of a rpm file out of an input stream.
-	 * 
-	 * @param rpmInputStream
-	 *            The input stream representing the rpm file
-	 * @throws IOException
-	 *             if an error occurs during read of the rpm file
-	 */
-	private void readFromStream(InputStream rpmInputStream) throws IOException {
-		InputStream inputStream = new DataInputStream(rpmInputStream);
+	final DataTypeIf payloadTag = getTag("PAYLOADFORMAT");
+	final String payloadFormat = payloadTag != null ? payloadTag.toString()
+		: "cpio";
+	final DataTypeIf payloadCompressionTag = getTag("PAYLOADCOMPRESSOR");
+	final String payloadCompressor = payloadCompressionTag != null ? payloadCompressionTag
+		.toString()
+		: "gzip";
 
-		lead = new RPMLead((DataInputStream) inputStream);
-		signature = new RPMSignature((DataInputStream) inputStream);
+	if (payloadFormat.equals("cpio")) {
+	    if (logger.isLoggable(Level.FINER)) {
+		logger.finer("PAYLOADCOMPRESSOR: " + payloadCompressor);
+	    }
 
-		if (logger.isLoggable(Level.FINER)) {
-			logger.finer("Signature Size: " + signature.getSize());
+	    if (payloadCompressor.equals("gzip")) {
+		inputStream = new GZIPInputStream(allCountInputStream);
+	    } else if (payloadCompressor.equals("bzip2")) {
+		inputStream = new CBZip2InputStream(allCountInputStream);
+	    } else if (payloadCompressor.equals("lzma")) {
+		try {
+		    final PipedOutputStream pout = new PipedOutputStream();
+		    inputStream = new PipedInputStream(pout);
+		    byte[] properties = new byte[5];
+		    if (allCountInputStream.read(properties, 0, 5) != 5)
+			throw (new IOException("input .lzma is too short"));
+		    final SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
+		    decoder.SetDecoderProperties(properties);
+		    long outSize = 0;
+		    for (int i = 0; i < 8; i++) {
+			int v = allCountInputStream.read();
+			if (v < 0)
+			    throw (new IOException("lzma error : Can't Read 1"));
+			outSize |= ((long) v) << (8 * i);
+		    }
+		    if (outSize == -1)
+			outSize = Long.MAX_VALUE;
+
+		    Decode decoderRunnable = new Decode(decoder,
+			    allCountInputStream, pout, outSize);
+		    Thread t = new Thread(decoderRunnable, "LZMA Decoder");
+		    t.start();
+		} catch (NoClassDefFoundError e) {
+		    String message = "No LZMA library found. Attach p7zip library to classpath (http://p7zip.sourceforge.net/)";
+		    logger.severe(message);
+		    throw new IOException(message);
 		}
+	    } else if (payloadCompressor.equals("none")) {
+		inputStream = allCountInputStream;
+	    } else {
+		throw new IOException("Unsupported compressor type "
+			+ payloadCompressor);
+	    }
 
-		header = new RPMHeader((DataInputStream) inputStream);
-
+	    ByteCountInputStream countInputStream = new ByteCountInputStream(
+		    inputStream);
+	    CPIOInputStream cpioInputStream = new CPIOInputStream(
+		    countInputStream);
+	    CPIOEntry readEntry;
+	    List fileNamesList = new ArrayList();
+	    String fileEntry;
+	    while ((readEntry = cpioInputStream.getNextEntry()) != null) {
 		if (logger.isLoggable(Level.FINER)) {
-			logger.finer("Header Size: " + header.getSize());
+		    logger.finer("Read CPIO entry: " + readEntry.getName()
+			    + " ;mode:" + readEntry.getMode());
 		}
+		if (readEntry.isRegularFile() || readEntry.isSymbolicLink()
+			|| readEntry.isDirectory()) {
+		    fileEntry = readEntry.getName();
+		    if (fileEntry.startsWith("./"))
+			fileEntry = fileEntry.substring(1);
+		    fileNamesList.add(fileEntry);
+		}
+	    }
+	    store.setTag("FILENAMES", TypeFactory
+		    .createSTRING_ARRAY((String[]) fileNamesList
+			    .toArray(new String[0])));
 
-		final DataTypeIf payloadTag = getTag("PAYLOADFORMAT");
-		final String payloadFormat = payloadTag != null ? payloadTag.toString()
-				: "cpio";
-		final DataTypeIf payloadCompressionTag = getTag("PAYLOADCOMPRESSOR");
-		final String payloadCompressor = payloadCompressionTag != null ? payloadCompressionTag
-				.toString()
-				: "gzip";
+	    setHeaderTagFromSignature("ARCHIVESIZE", "PAYLOADSIZE");
+	    // check ARCHIVESIZE with countInputStream.getCount();
+	    Object archiveSizeObject = getTag("ARCHIVESIZE");
+	    if (archiveSizeObject != null) {
+		if (archiveSizeObject instanceof INT32) {
+		    int archiveSize = ((INT32) archiveSizeObject).getData()[0];
+		    if (archiveSize != countInputStream.getCount()) {
+			new IOException("ARCHIVESIZE not correct");
+		    }
+		}
+	    }
+	    store.setTag("J_ARCHIVESIZE", TypeFactory
+		    .createINT64(new long[] { countInputStream.getCount() }));
+	} else {
+	    throw new IOException("Unsupported Payload type " + payloadFormat);
+	}
 
-		if (payloadFormat.equals("cpio")) {
-			if (logger.isLoggable(Level.FINER)) {
-				logger.finer("PAYLOADCOMPRESSOR: " + payloadCompressor);
-			}
+	// filling in signatures
+	// TODO: check signatures!
+	setHeaderTagFromSignature("SIGSIZE", "SIZE");
+	setHeaderTagFromSignature("SIGLEMD5_1", "LEMD5_1");
+	setHeaderTagFromSignature("SIGPGP", "PGP");
+	setHeaderTagFromSignature("SIGLEMD5_2", "LEMD5_2");
+	setHeaderTagFromSignature("SIGMD5", "MD5");
+	setHeaderTagFromSignature("SIGGPG", "GPG");
+	setHeaderTagFromSignature("SIGPGP5", "PGP5");
+	setHeaderTagFromSignature("DSAHEADER", "DSA");
+	setHeaderTagFromSignature("RSAHEADER", "RSA");
+	setHeaderTagFromSignature("SHA1HEADER", "SHA1");
 
-			if (payloadCompressor.equals("gzip")) {
-				inputStream = new GZIPInputStream(rpmInputStream);
-			} else if (payloadCompressor.equals("bzip2")) {
-				inputStream = new CBZip2InputStream(rpmInputStream);
-			} else if (payloadCompressor.equals("lzma")) {
-				try {
-					final PipedOutputStream pout = new PipedOutputStream();
-					inputStream = new PipedInputStream(pout);
-					byte[] properties = new byte[5];
-					if (rpmInputStream.read(properties, 0, 5) != 5)
-						throw (new IOException("input .lzma is too short"));
-					final SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
-					decoder.SetDecoderProperties(properties);
-					long outSize = 0;
-					for (int i = 0; i < 8; i++) {
-						int v = rpmInputStream.read();
-						if (v < 0)
-							throw (new IOException("lzma error : Can't Read 1"));
-						outSize |= ((long) v) << (8 * i);
-					}
-					if (outSize == -1)
-						outSize = Long.MAX_VALUE;
+	store.setTag("J_FILESIZE", TypeFactory
+		.createINT64(new long[] { allCountInputStream.getCount() }));
 
-					Decode decoderRunnable = new Decode(decoder,
-							rpmInputStream, pout, outSize);
-					Thread t = new Thread(decoderRunnable, "LZMA Decoder");
-					t.start();
-				} catch (NoClassDefFoundError e) {
-					String message = "No LZMA library found. Attach p7zip library to classpath (http://p7zip.sourceforge.net/)";
-					logger.severe(message);
-					throw new IOException(message);
-				}
-			} else if (payloadCompressor.equals("none")) {
-				inputStream = rpmInputStream;
-			} else {
-				throw new IOException("Unsupported compressor type "
-						+ payloadCompressor);
-			}
+	rpmInputStream.close();
+    }
 
-			ByteCountInputStream countInputStream = new ByteCountInputStream(
-					inputStream);
-			CPIOInputStream cpioInputStream = new CPIOInputStream(
-					countInputStream);
-			CPIOEntry readEntry;
-			List fileNamesList = new ArrayList();
-			String fileEntry;
-			while ((readEntry = cpioInputStream.getNextEntry()) != null) {
-				if (logger.isLoggable(Level.FINER)) {
-					logger.finer("Read CPIO entry: " + readEntry.getName()
-							+ " ;mode:" + readEntry.getMode());
-				}
-				if (readEntry.isRegularFile() || readEntry.isSymbolicLink()
-						|| readEntry.isDirectory()) {
-					fileEntry = readEntry.getName();
-					if (fileEntry.startsWith("./"))
-						fileEntry = fileEntry.substring(1);
-					fileNamesList.add(fileEntry);
-				}
-			}
-			getHeader().setTag(
-					"FILENAMES",
-					TypeFactory.createSTRING_ARRAY((String[]) fileNamesList
-							.toArray(new String[0])));
-		} else {
-			throw new IOException("Unsupported Payload type " + payloadFormat);
-		}
-		// TODO check ARCHIVESIZE with countInputStream.getCount();
+    private void setHeaderTagFromSignature(String headerTag, String signatureTag) {
+	if (store.getTag(headerTag) == null)
+	    store.setTag(headerTag, store.getTag(signatureTag));
+    }
 
-		// filling in signatures
-		// TODO: check signatures!
-		setHeaderTagFromSignature("SIGSIZE", "SIZE");
-		setHeaderTagFromSignature("SIGLEMD5_1", "LEMD5_1");
-		setHeaderTagFromSignature("SIGPGP", "PGP");
-		setHeaderTagFromSignature("SIGLEMD5_2", "LEMD5_2");
-		setHeaderTagFromSignature("SIGMD5", "MD5");
-		setHeaderTagFromSignature("SIGGPG", "GPG");
-		setHeaderTagFromSignature("SIGPGP5", "PGP5");
-		setHeaderTagFromSignature("BADSHA1_1", "BADSHA1_1");
-		setHeaderTagFromSignature("BADSHA1_2", "BADSHA1_2");
-		setHeaderTagFromSignature("DSAHEADER", "DSA");
-		setHeaderTagFromSignature("RSAHEADER", "RSA");
-		setHeaderTagFromSignature("SHA1HEADER", "SHA1");
-		setHeaderTagFromSignature("ARCHIVESIZE", "PAYLOADSIZE");
-		rpmInputStream.close();
+    /**
+         * Release locked resources.
+         */
+    public void close() {
+	reset();
+    }
 
+    /**
+         * Same as doing toXML(true).
+         * 
+         * @return String containing the XML representation of this RPM.
+         * @see #toXML(boolean)
+         */
+    public String toXML() {
+	StringWriter buf = new StringWriter();
+	try {
+	    toXML(buf, true);
+	    buf.flush();
+	    return buf.toString();
+	} catch (IOException e) {
+	    throw new RuntimeException(e);
 	}
+    }
 
-	private void setHeaderTagFromSignature(String headerTag, String signatureTag) {
-		if (getHeader().getTag(headerTag) == null)
-			getHeader().setTag(headerTag, getSignature().getTag(signatureTag));
+    /**
+         * Returns an XML version of this file
+         * 
+         * @param excludePayload
+         *                If this is true, the payload will not be included in
+         *                the XML.
+         * @return XML rpm.
+         */
+    public String toXML(boolean excludePayload) {
+	StringWriter buf = new StringWriter();
+	try {
+	    toXML(buf, excludePayload);
+	    buf.flush();
+	    return buf.toString();
+	} catch (IOException e) {
+	    throw new RuntimeException(e);
 	}
+    }
 
-	/**
-	 * Release locked resources.
-	 */
-	public void close() {
-		reset();
+    /**
+         * Outputs this rpm in an XML format to the specified i/o writer.
+         * 
+         * @param writer
+         *                Writer stream.
+         * @param excludePayload
+         *                If this is true, the payload will not be included in
+         *                the XML.
+         * @throws IOException
+         *                 If an error occurred writing to the writer.
+         */
+    public void toXML(Writer writer, boolean excludePayload) throws IOException {
+	// TODO
+    }
+
+    private class ByteCountInputStream extends FilterInputStream {
+	private int count = 0;
+
+	public ByteCountInputStream(InputStream is) {
+	    super(is);
 	}
 
-	/**
-	 * Same as doing toXML(true).
-	 * 
-	 * @return String containing the XML representation of this RPM.
-	 * @see #toXML(boolean)
-	 */
-	public String toXML() {
-		StringWriter buf = new StringWriter();
-		try {
-			toXML(buf, true);
-			buf.flush();
-			return buf.toString();
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		}
+	public int getCount() {
+	    return count;
 	}
 
-	/**
-	 * Returns an XML version of this file
-	 * 
-	 * @param excludePayload
-	 *            If this is true, the payload will not be included in the XML.
-	 * @return XML rpm.
-	 */
-	public String toXML(boolean excludePayload) {
-		StringWriter buf = new StringWriter();
-		try {
-			toXML(buf, excludePayload);
-			buf.flush();
-			return buf.toString();
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		}
+	public int read() throws IOException {
+	    count++;
+	    return in.read();
 	}
 
-	/**
-	 * Outputs this rpm in an XML format to the specified i/o writer.
-	 * 
-	 * @param writer
-	 *            Writer stream.
-	 * @param excludePayload
-	 *            If this is true, the payload will not be included in the XML.
-	 * @throws IOException
-	 *             If an error occurred writing to the writer.
-	 */
-	public void toXML(Writer writer, boolean excludePayload) throws IOException {
-		// TODO
+	public int read(byte b[]) throws IOException {
+	    int size = read(b, 0, b.length);
+	    count += size;
+	    return size;
 	}
 
-	private class ByteCountInputStream extends FilterInputStream {
-		private int count = 0;
-
-		public ByteCountInputStream(InputStream is) {
-			super(is);
-		}
-
-		public int getCount() {
-			return count;
-		}
-
-		public int read() throws IOException {
-			count++;
-			return in.read();
-		}
-
-		public int read(byte b[]) throws IOException {
-			int size = read(b, 0, b.length);
-			count += size;
-			return size;
-		}
-
-		public int read(byte b[], int off, int len) throws IOException {
-			int size = in.read(b, off, len);
-			count += size;
-			return size;
-		}
-
-		public long skip(long n) throws IOException {
-			long size = in.skip(n);
-			count += size;
-			return size;
-		}
+	public int read(byte b[], int off, int len) throws IOException {
+	    int size = in.read(b, off, len);
+	    count += size;
+	    return size;
 	}
 
-	/**
-	 * Load an RPM file using the native rpm executables.
-	 * 
-	 * @param file
-	 *            RPM file.
-	 */
-	public static RPMFile loadUsingNative(File file) {
-		return null; // TODO
+	public long skip(long n) throws IOException {
+	    long size = in.skip(n);
+	    count += size;
+	    return size;
 	}
+    }
 
-	static final class Decode implements Runnable {
-		private SevenZip.Compression.LZMA.Decoder decoder;
+    /**
+         * Load an RPM file using the native rpm executables.
+         * 
+         * @param file
+         *                RPM file.
+         */
+    public static RPMFile loadUsingNative(File file) {
+	return null; // TODO
+    }
 
-		private InputStream inputStream;
+    static final class Decode implements Runnable {
+	private SevenZip.Compression.LZMA.Decoder decoder;
 
-		private OutputStream outputStream;
+	private InputStream inputStream;
 
-		private long size;
+	private OutputStream outputStream;
 
-		public Decode(Decoder decoder, InputStream inputStream,
-				OutputStream outputStream, long size) {
-			super();
-			this.decoder = decoder;
-			this.inputStream = inputStream;
-			this.outputStream = outputStream;
-			this.size = size;
-		}
+	private long size;
 
-		public void run() {
-			try {
-				decoder.Code(inputStream, outputStream, size,
-						new ICodeProgress() {
-							public void SetProgress(long arg0, long arg1) {
-								// ignore
-							}
-						});
-				outputStream.close();
-			} catch (IOException e) {
-			}
-			try {
-				outputStream.close();
-			} catch (IOException e) {
-			}
-		}
+	public Decode(Decoder decoder, InputStream inputStream,
+		OutputStream outputStream, long size) {
+	    super();
+	    this.decoder = decoder;
+	    this.inputStream = inputStream;
+	    this.outputStream = outputStream;
+	    this.size = size;
 	}
+
+	public void run() {
+	    try {
+		decoder.Code(inputStream, outputStream, size,
+			new ICodeProgress() {
+			    public void SetProgress(long arg0, long arg1) {
+				// ignore
+			    }
+			});
+		outputStream.close();
+	    } catch (IOException e) {
+	    }
+	    try {
+		outputStream.close();
+	    } catch (IOException e) {
+	    }
+	}
+    }
 }

Modified: trunk/src/java/com/jguild/jrpm/io/RPMHeader.java
===================================================================
--- trunk/src/java/com/jguild/jrpm/io/RPMHeader.java	2008-04-20 17:14:01 UTC (rev 20)
+++ trunk/src/java/com/jguild/jrpm/io/RPMHeader.java	2008-06-19 00:35:46 UTC (rev 21)
@@ -7,74 +7,28 @@
 import java.io.DataInputStream;
 import java.io.IOException;
 
-import com.jguild.jrpm.io.constant.EnumIf;
-import com.jguild.jrpm.io.constant.RPMHeaderTag;
-
 /**
  * RPM Header.
- *
+ * 
  * @version $Id: RPMHeader.java,v 1.7 2004/09/09 09:52:48 pnasrat Exp $
  */
 public class RPMHeader extends Header {
     /**
-     * Creates a new RPMHeader object out of an input stream.
-     *
-     * @param inputStream
-     *           The input stream
-     *
-     * @throws IOException
-     *            if an error occured during read of the rpm
-     */
-    public RPMHeader(DataInputStream inputStream) throws IOException {
-        super(inputStream);
+         * Creates a new RPMHeader object out of an input stream.
+         * 
+         * @param inputStream
+         *                The input stream
+         * 
+         * @throws IOException
+         *                 if an error occured during read of the rpm
+         */
+    public RPMHeader(DataInputStream inputStream, Store store)
+	    throws IOException {
+	super(inputStream, store);
     }
 
-    public RPMHeader(DataInputStream inputStream, boolean raw) throws IOException {
-        super(inputStream, raw);
+    public RPMHeader(DataInputStream inputStream, boolean raw, Store store)
+	    throws IOException {
+	super(inputStream, raw, store);
     }
-
-    /**
-     * @see com.jguild.jrpm.io.Header#getKnownTagNames()
-     */
-    public static String[] getKnownTagNames() {
-        return RPMHeaderTag.getEnumNames();
-    }
-
-    /**
-     * @see com.jguild.jrpm.io.Header#getTagIdForName(java.lang.String)
-     */
-    public long getTagIdForName(String tagname) {
-        EnumIf e = RPMHeaderTag.getEnumByName(tagname);
-
-        if (e == null) {
-            throw new IllegalArgumentException("unknown tag with name <" + tagname + ">");
-        }
-
-        return e.getId();
-    }
-
-    /**
-     * @see com.jguild.jrpm.io.Header#getTagNameForId(long)
-     */
-    public String getTagNameForId(long tagid) {
-        EnumIf e = RPMHeaderTag.getEnumById(tagid);
-        if (e == null) {
-            throw new IllegalArgumentException("unknown tag with id <" + tagid + ">");
-        }
-        return e.getName();
-    }
-
-    /**
-     * @see com.jguild.jrpm.io.Header#isValidTag(long)
-     */
-    public boolean isValidTag(long tagid) {
-        return RPMHeaderTag.getEnumById(tagid) != null;
-    }
-
-    /**
-     * @see com.jguild.jrpm.io.Header#isValidTag(java.lang.String)
-     */
-    public boolean isValidTag(String tagname) {
-        return RPMHeaderTag.getEnumByName(tagname) != null;
-    }
-}
+}
\ No newline at end of file

Modified: trunk/src/java/com/jguild/jrpm/io/RPMSignature.java
===================================================================
--- trunk/src/java/com/jguild/jrpm/io/RPMSignature.java	2008-04-20 17:14:01 UTC (rev 20)
+++ trunk/src/java/com/jguild/jrpm/io/RPMSignature.java	2008-06-19 00:35:46 UTC (rev 21)
@@ -1,18 +1,23 @@
 /*
- * jGuild Project: jRPM
- * Released under the Apache License ( http://www.apache.org/LICENSE )
- */
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
 package com.jguild.jrpm.io;
 
 import java.io.DataInputStream;
 import java.io.IOException;
-
-import java.util.logging.Logger;
 import java.util.logging.Level;
+import java.util.logging.Logger;
 
-import com.jguild.jrpm.io.constant.EnumIf;
-import com.jguild.jrpm.io.constant.RPMSignatureTag;
-
 /**
  * RPM Signature.
  */
@@ -20,68 +25,29 @@
     private static final Logger logger = RPMFile.logger;
 
     /**
-     * Creates a new RPMSignature object from an input stream
-     *
-     * @param inputStream The input stream
-     * @throws IOException if an error occurs on reading informations out of the stream
-     */
-    public RPMSignature(DataInputStream inputStream) throws IOException {
-        super(inputStream);
+         * Creates a new RPMSignature object from an input stream
+         * 
+         * @param inputStream
+         *                The input stream
+         * @throws IOException
+         *                 if an error occurs on reading informations out of the
+         *                 stream
+         */
+    public RPMSignature(DataInputStream inputStream, Store store)
+	    throws IOException {
+	super(inputStream, store);
 
-        // Make signature size modulo 8 = 0
-        long fill = (size % 8L);
+	// Make signature size modulo 8 = 0
+	long fill = (size % 8L);
 
-        if (fill != 0) {
-            fill = 8 - fill;
-        }
+	if (fill != 0) {
+	    fill = 8 - fill;
+	}
 
-        if (logger.isLoggable(Level.FINER)) {
-            logger.finer("skip " + fill + " bytes for signature");
-        }
+	if (logger.isLoggable(Level.FINER)) {
+	    logger.finer("skip " + fill + " bytes for signature");
+	}
 
-        size += inputStream.skip(fill);
+	size += inputStream.skip(fill);
     }
-
-    /**
-     * @see com.jguild.jrpm.io.Header#getKnownTagNames()
-     */
-    public static String[] getKnownTagNames() {
-        return RPMSignatureTag.getEnumNames();
-    }
-
-    /**
-     * @see com.jguild.jrpm.io.Header#getTagIdForName(java.lang.String)
-     */
-    public long getTagIdForName(String tagname) {
-        EnumIf e = RPMSignatureTag.getEnumByName(tagname);
-        if (e == null) {
-            throw new IllegalArgumentException("unknown tag with name <" + tagname + ">");
-        }
-        return e.getId();
-    }
-
-    /**
-     * @see com.jguild.jrpm.io.Header#getTagNameForId(long)
-     */
-    public String getTagNameForId(long tagid) {
-        EnumIf e = RPMSignatureTag.getEnumById(tagid);
-        if (e == null) {
-            throw new IllegalArgumentException("unknown tag with id <" + tagid + ">");
-        }
-        return e.getName();
-    }
-
-    /**
-     * @see com.jguild.jrpm.io.Header#isValidTag(long)
-     */
-    public boolean isValidTag(long tagid) {
-        return RPMSignatureTag.getEnumById(tagid) != null;
-    }
-
-    /**
-     * @see com.jguild.jrpm.io.Header#isValidTag(java.lang.String)
-     */
-    public boolean isValidTag(String tagname) {
-        return RPMSignatureTag.getEnumByName(tagname) != null;
-    }
 }

Added: trunk/src/java/com/jguild/jrpm/io/Store.java
===================================================================
--- trunk/src/java/com/jguild/jrpm/io/Store.java	                        (rev 0)
+++ trunk/src/java/com/jguild/jrpm/io/Store.java	2008-06-19 00:35:46 UTC (rev 21)
@@ -0,0 +1,204 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
+package com.jguild.jrpm.io;
+
+import java.util.HashMap;
+import java.util.logging.Logger;
+
+import com.jguild.jrpm.io.constant.EnumIf;
+import com.jguild.jrpm.io.constant.RPMHeaderTag;
+import com.jguild.jrpm.io.datatype.DataTypeIf;
+
+/**
+ * @author kuss
+ * 
+ */
+public class Store {
+    public static final Logger logger = Logger.getLogger("jrpm.io");
+
+    private HashMap store = new HashMap();
+
+    /**
+         * Get a tag by id as a Long
+         * 
+         * @param tag
+         *                A tag id as a Long
+         * @return A data struct containing the data of this tag
+         */
+    public DataTypeIf getTag(Long tag) {
+	return (DataTypeIf) store.get(tag);
+    }
+
+    /**
+         * Get a tag by id as a long
+         * 
+         * @param tag
+         *                A tag id as a long
+         * @return A data struct containing the data of this tag
+         */
+    public DataTypeIf getTag(long tag) {
+	return getTag(new Long(tag));
+    }
+
+    /**
+         * Get a tag by name
+         * 
+         * @param tagname
+         *                A tag name
+         * @return A data struct containing the data of this tag
+         */
+    public DataTypeIf getTag(String tagname) {
+	return getTag(getTagIdForName(tagname));
+    }
+
+    /**
+         * Set a tag by id as a Long
+         * 
+         * @param tag
+         *                A tag id as a Long
+         * @param data
+         *                A data struct containing the data of this tag
+         */
+    public void setTag(Long tag, DataTypeIf data) {
+	isValidTag(tag.longValue());
+	store.put(tag, data);
+    }
+
+    /**
+         * Set a tag by id as a long
+         * 
+         * @param tag
+         *                A tag id as a long
+         * @param data
+         *                A data struct containing the data of this tag
+         */
+    public void setTag(long tag, DataTypeIf data) {
+	setTag(new Long(tag), data);
+    }
+
+    /**
+         * Set a tag by id as a string
+         * 
+         * @param tagname
+         *                A tag id as a string
+         * @param data
+         *                A data struct containing the data of this tag
+         */
+    public void setTag(String tagname, DataTypeIf data) {
+	setTag(getTagIdForName(tagname), data);
+    }
+
+    /**
+         * Get all tag ids contained in this rpm file.
+         * 
+         * @return All tag ids contained in this rpm file.
+         */
+    public long[] getTagIds() {
+	Long[] tmp = (Long[]) store.keySet().toArray(new Long[0]);
+	long[] ret = new long[tmp.length];
+
+	for (int i = 0; i < tmp.length; i++) {
+	    ret[i] = tmp[i].longValue();
+	}
+
+	return ret;
+    }
+
+    /**
+         * Get all tag names contained in this rpm file.
+         * 
+         * @return All tag names contained in this rpm file.
+         */
+    public String[] getTagNames() {
+	Long[] tmp = (Long[]) store.keySet().toArray(new Long[0]);
+	String[] ret = new String[tmp.length];
+
+	for (int i = 0; i < tmp.length; i++) {
+	    ret[i] = getTagNameForId(tmp[i].longValue());
+	}
+
+	return ret;
+    }
+
+    /**
+         * Read a tag with a given tag name. The tag will be read out of the
+         * class defined in getTagEnum().
+         * 
+         * @param tagname
+         *                A RPM tag name
+         * @return The id of the RPM tag
+         * @throws IllegalArgumentException
+         *                 if the tag name was not found
+         */
+    public long getTagIdForName(String tagname) {
+	EnumIf e = RPMHeaderTag.getEnumByName(tagname);
+
+	if (e == null) {
+	    throw new IllegalArgumentException("unknown tag with name <"
+		    + tagname + ">");
+	}
+
+	return e.getId();
+    }
+
+    /**
+         * Read a tag with a given tag id. The tag will be read out of the class
+         * defined in getTagEnum().
+         * 
+         * @param tagid
+         *                A RPM tag id
+         * @return The name of the RPM tag
+         * @throws IllegalArgumentException
+         *                 if the tag id was not found
+         */
+    public String getTagNameForId(long tagid) {
+	EnumIf e = RPMHeaderTag.getEnumById(tagid);
+	if (e == null) {
+	    throw new IllegalArgumentException("unknown tag with id <" + tagid
+		    + ">");
+	}
+	return e.getName();
+    }
+
+    /**
+         * Test if the given tagid is associated with a valid tag
+         * 
+         * @param tagid
+         *                The id of a tag
+         * @return TRUE if the tagid is valid
+         */
+    public boolean isValidTag(long tagid) {
+	return RPMHeaderTag.getEnumById(tagid) != null;
+    }
+
+    /**
+         * Test if the given tagname is associated with a valid tag
+         * 
+         * @param tagname
+         *                The name of a tag
+         * @return TRUE if the tagname is valid
+         */
+    public boolean isValidTag(String tagname) {
+	return RPMHeaderTag.getEnumByName(tagname) != null;
+    }
+
+    /**
+         * Read all known tag names for this header structure.
+         * 
+         * @return An array of tag names
+         */
+    public static String[] getKnownTagNames() {
+	return RPMHeaderTag.getEnumNames();
+    }
+}

Modified: trunk/src/java/com/jguild/jrpm/io/constant/EnumDelegate.java
===================================================================
--- trunk/src/java/com/jguild/jrpm/io/constant/EnumDelegate.java	2008-04-20 17:14:01 UTC (rev 20)
+++ trunk/src/java/com/jguild/jrpm/io/constant/EnumDelegate.java	2008-06-19 00:35:46 UTC (rev 21)
@@ -61,6 +61,7 @@
             ret = (EnumIf) mapEntry.idMap.get(new Long(id));
 
             if (ret == null) {
+        	// warn
                 ret = (EnumIf) mapEntry.idMap.get(new Long(_UNKNOWN));
             }
         }

Modified: trunk/src/java/com/jguild/jrpm/io/constant/RPMHeaderTag.java
===================================================================
--- trunk/src/java/com/jguild/jrpm/io/constant/RPMHeaderTag.java	2008-04-20 17:14:01 UTC (rev 20)
+++ trunk/src/java/com/jguild/jrpm/io/constant/RPMHeaderTag.java	2008-06-19 00:35:46 UTC (rev 21)
@@ -4,424 +4,1275 @@
  */
 package com.jguild.jrpm.io.constant;
 
-
 /**
  * Constants for tags.
- *
+ * 
  * @version $Id: RPMHeaderTag.java,v 1.4 2004/05/06 20:59:24 mkuss Exp $
  */
 public final class RPMHeaderTag implements EnumIf {
-   public static final RPMHeaderTag UNKNOWN = new RPMHeaderTag(_UNKNOWN, "UNKNOWN");
-   public static final int _HEADERIMAGE = 61;
-   public static final RPMHeaderTag HEADERIMAGE = new RPMHeaderTag(_HEADERIMAGE, "HEADERIMAGE");
-   public static final int _HEADERSIGNATURES = 62;
-   public static final RPMHeaderTag HEADERSIGNATURES = new RPMHeaderTag(_HEADERSIGNATURES, "HEADERSIGNATURES");
-   public static final int _HEADERIMMUTABLE = 63;
-   public static final RPMHeaderTag HEADERIMMUTABLE = new RPMHeaderTag(_HEADERIMMUTABLE, "HEADERIMMUTABLE");
-   public static final int _HEADERREGIONS = 64;
-   public static final RPMHeaderTag HEADERREGIONS = new RPMHeaderTag(_HEADERREGIONS, "HEADERREGIONS");
-   public static final int _HEADERI18NTABLE = 100;
-   public static final RPMHeaderTag HEADERI18NTABLE = new RPMHeaderTag(_HEADERI18NTABLE, "HEADERI18NTABLE");
-   public static final int _SIG_BASE = 256;
-   public static final RPMHeaderTag SIG_BASE = new RPMHeaderTag(_SIG_BASE, "SIG_BASE");
-   public static final int _SIGSIZE = 257;
-   public static final RPMHeaderTag SIGSIZE = new RPMHeaderTag(_SIGSIZE, "SIGSIZE");
-   public static final int _SIGLEMD5_1 = 258;
-   public static final RPMHeaderTag SIGLEMD5_1 = new RPMHeaderTag(_SIGLEMD5_1, "SIGLEMD5_1");
-   public static final int _SIGPGP = 259;
-   public static final RPMHeaderTag SIGPGP = new RPMHeaderTag(_SIGPGP, "SIGPGP");
-   public static final int _SIGLEMD5_2 = 260;
-   public static final RPMHeaderTag SIGLEMD5_2 = new RPMHeaderTag(_SIGLEMD5_2, "SIGLEMD5_2");
-   public static final int _SIGMD5 = 261;
-   public static final RPMHeaderTag SIGMD5 = new RPMHeaderTag(_SIGMD5, "SIGMD5");
-   public static final RPMHeaderTag PKGID = new RPMHeaderTag(_SIGMD5, "PKGID");
-   public static final int _SIGGPG = 262;
-   public static final RPMHeaderTag SIGGPG = new RPMHeaderTag(_SIGGPG, "SIGGPG");
-   public static final int _SIGPGP5 = 263;
-   public static final RPMHeaderTag SIGPGP5 = new RPMHeaderTag(_SIGPGP5, "SIGPGP5");
-   public static final int _BADSHA1_1 = 264;
-   public static final RPMHeaderTag BADSHA1_1 = new RPMHeaderTag(_BADSHA1_1, "BADSHA1_1");
-   public static final int _BADSHA1_2 = 265;
-   public static final RPMHeaderTag BADSHA1_2 = new RPMHeaderTag(_BADSHA1_2, "BADSHA1_2");
-   public static final int _PUBKEYS = 266;
-   public static final RPMHeaderTag PUBKEYS = new RPMHeaderTag(_PUBKEYS, "PUBKEYS");
-   public static final int _DSAHEADER = 267;
-   public static final RPMHeaderTag DSAHEADER = new RPMHeaderTag(_DSAHEADER, "DSAHEADER");
-   public static final int _RSAHEADER = 268;
-   public static final RPMHeaderTag RSAHEADER = new RPMHeaderTag(_RSAHEADER, "RSAHEADER");
-   public static final int _SHA1HEADER = 269;
-   public static final RPMHeaderTag SHA1HEADER = new RPMHeaderTag(_SHA1HEADER, "SHA1HEADER");
-   public static final RPMHeaderTag HDRID = new RPMHeaderTag(_SHA1HEADER, "HDRID");
-   public static final int _NAME = 1000;
-   public static final RPMHeaderTag NAME = new RPMHeaderTag(_NAME, "NAME");
-   public static final RPMHeaderTag N = new RPMHeaderTag(_NAME, "N");
-   public static final int _VERSION = 1001;
-   public static final RPMHeaderTag VERSION = new RPMHeaderTag(_VERSION, "VERSION");
-   public static final RPMHeaderTag V = new RPMHeaderTag(_VERSION, "V");
-   public static final int _RELEASE = 1002;
-   public static final RPMHeaderTag RELEASE = new RPMHeaderTag(_RELEASE, "RELEASE");
-   public static final RPMHeaderTag R = new RPMHeaderTag(_RELEASE, "R");
-   public static final int _EPOCH = 1003;
-   public static final RPMHeaderTag EPOCH = new RPMHeaderTag(_EPOCH, "EPOCH");
-   public static final RPMHeaderTag E = new RPMHeaderTag(_EPOCH, "E");
-   /* backward comaptibility */
-   public static final RPMHeaderTag SERIAL = new RPMHeaderTag(_EPOCH, "SERIAL");
-   public static final int _SUMMARY = 1004;
-   public static final RPMHeaderTag SUMMARY = new RPMHeaderTag(_SUMMARY, "SUMMARY");
-   public static final int _DESCRIPTION = 1005;
-   public static final RPMHeaderTag DESCRIPTION = new RPMHeaderTag(_DESCRIPTION, "DESCRIPTION");
-   public static final int _BUILDTIME = 1006;
-   public static final RPMHeaderTag BUILDTIME = new RPMHeaderTag(_BUILDTIME, "BUILDTIME");
-   public static final int _BUILDHOST = 1007;
-   public static final RPMHeaderTag BUILDHOST = new RPMHeaderTag(_BUILDHOST, "BUILDHOST");
-   public static final int _INSTALLTIME = 1008;
-   public static final RPMHeaderTag INSTALLTIME = new RPMHeaderTag(_INSTALLTIME, "INSTALLTIME");
-   public static final int _SIZE = 1009;
-   public static final RPMHeaderTag SIZE = new RPMHeaderTag(_SIZE, "SIZE");
-   public static final int _DISTRIBUTION = 1010;
-   public static final RPMHeaderTag DISTRIBUTION = new RPMHeaderTag(_DISTRIBUTION, "DISTRIBUTION");
-   public static final int _VENDOR = 1011;
-   public static final RPMHeaderTag VENDOR = new RPMHeaderTag(_VENDOR, "VENDOR");
-   public static final int _GIF = 1012;
-   public static final RPMHeaderTag GIF = new RPMHeaderTag(_GIF, "GIF");
-   public static final int _XPM = 1013;
-   public static final RPMHeaderTag XPM = new RPMHeaderTag(_XPM, "XPM");
-   public static final int _LICENSE = 1014;
-   public static final RPMHeaderTag LICENSE = new RPMHeaderTag(_LICENSE, "LICENSE");
-   /* backward comaptibility */
-   public static final RPMHeaderTag COPYRIGHT = new RPMHeaderTag(_LICENSE, "COPYRIGHT");
-   public static final int _PACKAGER = 1015;
-   public static final RPMHeaderTag PACKAGER = new RPMHeaderTag(_PACKAGER, "PACKAGER");
-   public static final int _GROUP = 1016;
-   public static final RPMHeaderTag GROUP = new RPMHeaderTag(_GROUP, "GROUP");
-   public static final int _CHANGELOG = 1017;
-   public static final RPMHeaderTag CHANGELOG = new RPMHeaderTag(_CHANGELOG, "CHANGELOG");
-   public static final int _SOURCE = 1018;
-   public static final RPMHeaderTag SOURCE = new RPMHeaderTag(_SOURCE, "SOURCE");
-   public static final int _PATCH = 1019;
-   public static final RPMHeaderTag PATCH = new RPMHeaderTag(_PATCH, "PATCH");
-   public static final int _URL = 1020;
-   public static final RPMHeaderTag URL = new RPMHeaderTag(_URL, "URL");
-   public static final int _OS = 1021;
-   public static final RPMHeaderTag OS = new RPMHeaderTag(_OS, "OS");
-   public static final int _ARCH = 1022;
-   public static final RPMHeaderTag ARCH = new RPMHeaderTag(_ARCH, "ARCH");
-   public static final int _PREIN = 1023;
-   public static final RPMHeaderTag PREIN = new RPMHeaderTag(_PREIN, "PREIN");
-   public static final int _POSTIN = 1024;
-   public static final RPMHeaderTag POSTIN = new RPMHeaderTag(_POSTIN, "POSTIN");
-   public static final int _PREUN = 1025;
-   public static final RPMHeaderTag PREUN = new RPMHeaderTag(_PREUN, "PREUN");
-   public static final int _POSTUN = 1026;
-   public static final RPMHeaderTag POSTUN = new RPMHeaderTag(_POSTUN, "POSTUN");
-   public static final int _OLDFILENAMES = 1027;
-   public static final RPMHeaderTag OLDFILENAMES = new RPMHeaderTag(_OLDFILENAMES, "OLDFILENAMES");
-   public static final int _FILESIZES = 1028;
-   public static final RPMHeaderTag FILESIZES = new RPMHeaderTag(_FILESIZES, "FILESIZES");
-   public static final int _FILESTATES = 1029;
-   public static final RPMHeaderTag FILESTATES = new RPMHeaderTag(_FILESTATES, "FILESTATES");
-   public static final int _FILEMODES = 1030;
-   public static final RPMHeaderTag FILEMODES = new RPMHeaderTag(_FILEMODES, "FILEMODES");
-   public static final int _FILEUIDS = 1031;
-   public static final RPMHeaderTag FILEUIDS = new RPMHeaderTag(_FILEUIDS, "FILEUIDS");
-   public static final int _FILEGIDS = 1032;
-   public static final RPMHeaderTag FILEGIDS = new RPMHeaderTag(_FILEGIDS, "FILEGIDS");
-   public static final int _FILERDEVS = 1033;
-   public static final RPMHeaderTag FILERDEVS = new RPMHeaderTag(_FILERDEVS, "FILERDEVS");
-   public static final int _FILEMTIMES = 1034;
-   public static final RPMHeaderTag FILEMTIMES = new RPMHeaderTag(_FILEMTIMES, "FILEMTIMES");
-   public static final int _FILEMD5S = 1035;
-   public static final RPMHeaderTag FILEMD5S = new RPMHeaderTag(_FILEMD5S, "FILEMD5S");
-   public static final int _FILELINKTOS = 1036;
-   public static final RPMHeaderTag FILELINKTOS = new RPMHeaderTag(_FILELINKTOS, "FILELINKTOS");
-   public static final int _FILEFLAGS = 1037;
-   public static final RPMHeaderTag FILEFLAGS = new RPMHeaderTag(_FILEFLAGS, "FILEFLAGS");
-   public static final int _ROOT = 1038;
-   public static final RPMHeaderTag ROOT = new RPMHeaderTag(_ROOT, "ROOT");
-   public static final int _FILEUSERNAME = 1039;
-   public static final RPMHeaderTag FILEUSERNAME = new RPMHeaderTag(_FILEUSERNAME, "FILEUSERNAME");
-   public static final int _FILEGROUPNAME = 1040;
-   public static final RPMHeaderTag FILEGROUPNAME = new RPMHeaderTag(_FILEGROUPNAME, "FILEGROUPNAME");
-   public static final int _EXCLUDE = 1041;
-   public static final RPMHeaderTag EXCLUDE = new RPMHeaderTag(_EXCLUDE, "EXCLUDE");
-   public static final int _EXCLUSIVE = 1042;
-   public static final RPMHeaderTag EXCLUSIVE = new RPMHeaderTag(_EXCLUSIVE, "EXCLUSIVE");
-   public static final int _ICON = 1043;
-   public static final RPMHeaderTag ICON = new RPMHeaderTag(_ICON, "ICON");
-   public static final int _SOURCERPM = 1044;
-   public static final RPMHeaderTag SOURCERPM = new RPMHeaderTag(_SOURCERPM, "SOURCERPM");
-   public static final int _FILEVERIFYFLAGS = 1045;
-   public static final RPMHeaderTag FILEVERIFYFLAGS = new RPMHeaderTag(_FILEVERIFYFLAGS, "FILEVERIFYFLAGS");
-   public static final int _ARCHIVESIZE = 1046;
-   public static final RPMHeaderTag ARCHIVESIZE = new RPMHeaderTag(_ARCHIVESIZE, "ARCHIVESIZE");
-   public static final int _PROVIDENAME = 1047;
-   public static final RPMHeaderTag PROVIDENAME = new RPMHeaderTag(_PROVIDENAME, "PROVIDENAME");
-   /* backward comaptibility */
-   public static final RPMHeaderTag PROVIDES = new RPMHeaderTag(_PROVIDENAME, "PROVIDES");
-   public static final int _REQUIREFLAGS = 1048;
-   public static final RPMHeaderTag REQUIREFLAGS = new RPMHeaderTag(_REQUIREFLAGS, "REQUIREFLAGS");
-   public static final int _REQUIRENAME = 1049;
-   public static final RPMHeaderTag REQUIRENAME = new RPMHeaderTag(_REQUIRENAME, "REQUIRENAME");
-   public static final int _REQUIREVERSION = 1050;
-   public static final RPMHeaderTag REQUIREVERSION = new RPMHeaderTag(_REQUIREVERSION, "REQUIREVERSION");
-   public static final int _NOSOURCE = 1051;
-   public static final RPMHeaderTag NOSOURCE = new RPMHeaderTag(_NOSOURCE, "NOSOURCE");
-   public static final int _NOPATCH = 1052;
-   public static final RPMHeaderTag NOPATCH = new RPMHeaderTag(_NOPATCH, "NOPATCH");
-   public static final int _CONFLICTFLAGS = 1053;
-   public static final RPMHeaderTag CONFLICTFLAGS = new RPMHeaderTag(_CONFLICTFLAGS, "CONFLICTFLAGS");
-   public static final int _CONFLICTNAME = 1054;
-   public static final RPMHeaderTag CONFLICTNAME = new RPMHeaderTag(_CONFLICTNAME, "CONFLICTNAME");
-   public static final int _CONFLICTVERSION = 1055;
-   public static final RPMHeaderTag CONFLICTVERSION = new RPMHeaderTag(_CONFLICTVERSION, "CONFLICTVERSION");
-   public static final int _DEFAULTPREFIX = 1056;
-   public static final RPMHeaderTag DEFAULTPREFIX = new RPMHeaderTag(_DEFAULTPREFIX, "DEFAULTPREFIX");
-   public static final int _BUILDROOT = 1057;
-   public static final RPMHeaderTag BUILDROOT = new RPMHeaderTag(_BUILDROOT, "BUILDROOT");
-   public static final int _INSTALLPREFIX = 1058;
-   public static final RPMHeaderTag INSTALLPREFIX = new RPMHeaderTag(_INSTALLPREFIX, "INSTALLPREFIX");
-   public static final int _EXCLUDEARCH = 1059;
-   public static final RPMHeaderTag EXCLUDEARCH = new RPMHeaderTag(_EXCLUDEARCH, "EXCLUDEARCH");
-   public static final int _EXCLUDEOS = 1060;
-   public static final RPMHeaderTag EXCLUDEOS = new RPMHeaderTag(_EXCLUDEOS, "EXCLUDEOS");
-   public static final int _EXCLUSIVEARCH = 1061;
-   public static final RPMHeaderTag EXCLUSIVEARCH = new RPMHeaderTag(_EXCLUSIVEARCH, "EXCLUSIVEARCH");
-   public static final int _EXCLUSIVEOS = 1062;
-   public static final RPMHeaderTag EXCLUSIVEOS = new RPMHeaderTag(_EXCLUSIVEOS, "EXCLUSIVEOS");
-   public static final int _AUTOREQPROV = 1063;
-   public static final RPMHeaderTag AUTOREQPROV = new RPMHeaderTag(_AUTOREQPROV, "AUTOREQPROV");
-   public static final int _RPMVERSION = 1064;
-   public static final RPMHeaderTag RPMVERSION = new RPMHeaderTag(_RPMVERSION, "RPMVERSION");
-   public static final int _TRIGGERSCRIPTS = 1065;
-   public static final RPMHeaderTag TRIGGERSCRIPT = new RPMHeaderTag(_TRIGGERSCRIPTS, "TRIGGERSCRIPTS");
-   public static final int _TRIGGERNAME = 1066;
-   public static final RPMHeaderTag TRIGGERNAME = new RPMHeaderTag(_TRIGGERNAME, "TRIGGERNAME");
-   public static final int _TRIGGERVERSION = 1067;
-   public static final RPMHeaderTag TRIGGERVERSION = new RPMHeaderTag(_TRIGGERVERSION, "TRIGGERVERSION");
-   public static final int _TRIGGERFLAGS = 1068;
-   public static final RPMHeaderTag TRIGGERFLAGS = new RPMHeaderTag(_TRIGGERFLAGS, "TRIGGERFLAGS");
-   public static final int _TRIGGERINDEX = 1069;
-   public static final RPMHeaderTag TRIGGERINDEX = new RPMHeaderTag(_TRIGGERINDEX, "TRIGGERINDEX");
-   public static final int _VERIFYSCRIPT = 1079;
-   public static final RPMHeaderTag VERIFYSCRIPT = new RPMHeaderTag(_VERIFYSCRIPT, "VERIFYSCRIPT");
-   public static final int _CHANGELOGTIME = 1080;
-   public static final RPMHeaderTag CHANGELOGTIME = new RPMHeaderTag(_CHANGELOGTIME, "CHANGELOGTIME");
-   public static final int _CHANGELOGNAME = 1081;
-   public static final RPMHeaderTag CHANGELOGNAME = new RPMHeaderTag(_CHANGELOGNAME, "CHANGELOGNAME");
-   public static final int _CHANGELOGTEXT = 1082;
-   public static final RPMHeaderTag CHANGELOGTEXT = new RPMHeaderTag(_CHANGELOGTEXT, "CHANGELOGTEXT");
-   public static final int _BROKENMD5 = 1083;
-   public static final RPMHeaderTag BROKENMD5 = new RPMHeaderTag(_BROKENMD5, "BROKENMD5");
-   public static final int _PREREQ = 1084;
-   public static final RPMHeaderTag PREREQ = new RPMHeaderTag(_PREREQ, "PREREQ");
-   public static final int _PREINPROG = 1085;
-   public static final RPMHeaderTag PREINPROG = new RPMHeaderTag(_PREINPROG, "PREINPROG");
-   public static final int _POSTINPROG = 1086;
-   public static final RPMHeaderTag POSTINPROG = new RPMHeaderTag(_POSTINPROG, "POSTINPROG");
-   public static final int _PREUNPROG = 1087;
-   public static final RPMHeaderTag PREUNPROG = new RPMHeaderTag(_PREUNPROG, "PREUNPROG");
-   public static final int _POSTUNPROG = 1088;
-   public static final RPMHeaderTag POSTUNPROG = new RPMHeaderTag(_POSTUNPROG, "POSTUNPROG");
-   public static final int _BUILDARCHS = 1089;
-   public static final RPMHeaderTag BUILDARCHS = new RPMHeaderTag(_BUILDARCHS, "BUILDARCHS");
-   public static final int _OBSOLETENAME = 1090;
-   public static final RPMHeaderTag OBSOLETENAME = new RPMHeaderTag(_OBSOLETENAME, "OBSOLETENAME");
-   /* backward comaptibility */
-   public static final RPMHeaderTag OBSOLETES = new RPMHeaderTag(_OBSOLETENAME, "OBSOLETES");
-   public static final int _VERIFYSCRIPTPROG = 1091;
-   public static final RPMHeaderTag VERIFYSCRIPTPROG = new RPMHeaderTag(_VERIFYSCRIPTPROG, "VERIFYSCRIPTPROG");
-   public static final int _TRIGGERSCRIPTPROG = 1092;
-   public static final RPMHeaderTag TRIGGERSCRIPTPROG = new RPMHeaderTag(_TRIGGERSCRIPTPROG, "TRIGGERSCRIPTPROG");
-   public static final int _DOCDIR = 1093;
-   public static final RPMHeaderTag DOCDIR = new RPMHeaderTag(_DOCDIR, "DOCDIR");
-   public static final int _COOKIE = 1094;
-   public static final RPMHeaderTag COOKIE = new RPMHeaderTag(_COOKIE, "COOKIE");
-   public static final int _FILEDEVICES = 1095;
-   public static final RPMHeaderTag FILEDEVICES = new RPMHeaderTag(_FILEDEVICES, "FILEDEVICES");
-   public static final int _FILEINODES = 1096;
-   public static final RPMHeaderTag FILEINODES = new RPMHeaderTag(_FILEINODES, "FILEINODES");
-   public static final int _FILELANGS = 1097;
-   public static final RPMHeaderTag FILELANGS = new RPMHeaderTag(_FILELANGS, "FILELANGS");
-   public static final int _PREFIXES = 1098;
-   public static final RPMHeaderTag PREFIXES = new RPMHeaderTag(_PREFIXES, "PREFIXES");
-   public static final int _INSTPREFIXES = 1099;
-   public static final RPMHeaderTag INSTPREFIXES = new RPMHeaderTag(_INSTPREFIXES, "INSTPREFIXES");
-   public static final int _TRIGGERIN = 1100;
-   public static final RPMHeaderTag TRIGGERIN = new RPMHeaderTag(_TRIGGERIN, "TRIGGERIN");
-   public static final int _TRIGGERUN = 1101;
-   public static final RPMHeaderTag TRIGGERUN = new RPMHeaderTag(_TRIGGERUN, "TRIGGERUN");
-   public static final int _TRIGGERPOSTUN = 1102;
-   public static final RPMHeaderTag TRIGGERPOSTUN = new RPMHeaderTag(_TRIGGERPOSTUN, "TRIGGERPOSTUN");
-   public static final int _AUTOREQ = 1103;
-   public static final RPMHeaderTag AUTOREQ = new RPMHeaderTag(_AUTOREQ, "AUTOREQ");
-   public static final int _AUTOPROV = 1104;
-   public static final RPMHeaderTag AUTOPROV = new RPMHeaderTag(_AUTOPROV, "AUTOPROV");
-   public static final int _CAPABILITY = 1105;
-   public static final RPMHeaderTag CAPABILITY = new RPMHeaderTag(_CAPABILITY, "CAPABILITY");
-   public static final int _SOURCEPACKAGE = 1106;
-   public static final RPMHeaderTag SOURCEPACKAGE = new RPMHeaderTag(_SOURCEPACKAGE, "SOURCEPACKAGE");
-   public static final int _OLDORIGFILENAMES = 1107;
-   public static final RPMHeaderTag OLDORIGFILENAMES = new RPMHeaderTag(_OLDORIGFILENAMES, "OLDORIGFILENAMES");
-   public static final int _BUILDPREREQ = 1108;
-   public static final RPMHeaderTag BUILDPREREQ = new RPMHeaderTag(_BUILDPREREQ, "BUILDPREREQ");
-   public static final int _BUILDREQUIRES = 1109;
-   public static final RPMHeaderTag BUILDREQUIRES = new RPMHeaderTag(_BUILDREQUIRES, "BUILDREQUIRES");
-   public static final int _BUILDCONFLICTS = 1110;
-   public static final RPMHeaderTag BUILDCONFLICTS = new RPMHeaderTag(_BUILDCONFLICTS, "BUILDCONFLICTS");
-   public static final int _BUILDMACROS = 1111;
-   public static final RPMHeaderTag BUILDMACROS = new RPMHeaderTag(_BUILDMACROS, "BUILDMACROS");
-   public static final int _PROVIDEFLAGS = 1112;
-   public static final RPMHeaderTag PROVIDEFLAGS = new RPMHeaderTag(_PROVIDEFLAGS, "PROVIDEFLAGS");
-   public static final int _PROVIDEVERSION = 1113;
-   public static final RPMHeaderTag PROVIDEVERSION = new RPMHeaderTag(_PROVIDEVERSION, "PROVIDEVERSION");
-   public static final int _OBSOLETEFLAGS = 1114;
-   public static final RPMHeaderTag OBSOLETEFLAGS = new RPMHeaderTag(_OBSOLETEFLAGS, "OBSOLETEFLAGS");
-   public static final int _OBSOLETEVERSION = 1115;
-   public static final RPMHeaderTag OBSOLETEVERSION = new RPMHeaderTag(_OBSOLETEVERSION, "OBSOLETEVERSION");
-   public static final int _DIRINDEXES = 1116;
-   public static final RPMHeaderTag DIRINDEXES = new RPMHeaderTag(_DIRINDEXES, "DIRINDEXES");
-   public static final int _BASENAMES = 1117;
-   public static final RPMHeaderTag BASENAMES = new RPMHeaderTag(_BASENAMES, "BASENAMES");
-   public static final int _DIRNAMES = 1118;
-   public static final RPMHeaderTag DIRNAMES = new RPMHeaderTag(_DIRNAMES, "DIRNAMES");
-   public static final int _ORIGDIRINDEXES = 1119;
-   public static final RPMHeaderTag ORIGDIRINDEXES = new RPMHeaderTag(_ORIGDIRINDEXES, "ORIGDIRINDEXES");
-   public static final int _ORIGBASENAMES = 1120;
-   public static final RPMHeaderTag ORIGBASENAMES = new RPMHeaderTag(_ORIGBASENAMES, "ORIGBASENAMES");
-   public static final int _ORIGDIRNAMES = 1121;
-   public static final RPMHeaderTag ORIGDIRNAMES = new RPMHeaderTag(_ORIGDIRNAMES, "ORIGDIRNAMES");
-   public static final int _OPTFLAGS = 1122;
-   public static final RPMHeaderTag OPTFLAGS = new RPMHeaderTag(_OPTFLAGS, "OPTFLAGS");
-   public static final int _DISTURL = 1123;
-   public static final RPMHeaderTag DISTURL = new RPMHeaderTag(_DISTURL, "DISTURL");
-   public static final int _PAYLOADFORMAT = 1124;
-   public static final RPMHeaderTag PAYLOADFORMAT = new RPMHeaderTag(_PAYLOADFORMAT, "PAYLOADFORMAT");
-   public static final int _PAYLOADCOMPRESSOR = 1125;
-   public static final RPMHeaderTag PAYLOADCOMPRESSOR = new RPMHeaderTag(_PAYLOADCOMPRESSOR, "PAYLOADCOMPRESSOR");
-   public static final int _PAYLOADFLAGS = 1126;
-   public static final RPMHeaderTag PAYLOADFLAGS = new RPMHeaderTag(_PAYLOADFLAGS, "PAYLOADFLAGS");
-   public static final int _INSTALLCOLOR = 1127;
-   public static final RPMHeaderTag INSTALLCOLOR = new RPMHeaderTag(_INSTALLCOLOR, "INSTALLCOLOR");
-   public static final int _INSTALLTID = 1128;
-   public static final RPMHeaderTag INSTALLTID = new RPMHeaderTag(_INSTALLTID, "INSTALLTID");
-   public static final int _REMOVETID = 1129;
-   public static final RPMHeaderTag REMOVETID = new RPMHeaderTag(_REMOVETID, "REMOVETID");
-   public static final int _SHA1RHN = 1130;
-   public static final RPMHeaderTag SHA1RHN = new RPMHeaderTag(_SHA1RHN, "SHA1RHN");
-   public static final int _RHNPLATFORM = 1131;
-   public static final RPMHeaderTag RHNPLATFORM = new RPMHeaderTag(_RHNPLATFORM, "RHNPLATFORM");
-   public static final int _PLATFORM = 1132;
-   public static final RPMHeaderTag PLATFORM = new RPMHeaderTag(_PLATFORM, "PLATFORM");
-   public static final int _PATCHESNAME = 1133;
-   public static final RPMHeaderTag PATCHESNAME = new RPMHeaderTag(_PATCHESNAME, "PATCHESNAME");
-   public static final int _PATCHESFLAGS = 1134;
-   public static final RPMHeaderTag PATCHESFLAGS = new RPMHeaderTag(_PATCHESFLAGS, "PATCHESFLAGS");
-   public static final int _PATCHESVERSION = 1135;
-   public static final RPMHeaderTag PATCHESVERSION = new RPMHeaderTag(_PATCHESVERSION, "PATCHESVERSION");
-   public static final int _CACHECTIME = 1136;
-   public static final RPMHeaderTag CACHECTIME = new RPMHeaderTag(_CACHECTIME, "CACHECTIME");
-   public static final int _CACHEPKGPATH = 1137;
-   public static final RPMHeaderTag CACHEPKGPATH = new RPMHeaderTag(_CACHEPKGPATH, "CACHEPKGPATH");
-   public static final int _CACHEPKGSIZE = 1138;
-   public static final RPMHeaderTag CACHEPKGSIZE = new RPMHeaderTag(_CACHEPKGSIZE, "CACHEPKGSIZE");
-   public static final int _CACHEPKGMTIME = 1139;
-   public static final RPMHeaderTag CACHEPKGMTIME = new RPMHeaderTag(_CACHEPKGMTIME, "CACHEPKGMTIME");
-   public static final int _FILECOLORS = 1140;
-   public static final RPMHeaderTag FILECOLORS = new RPMHeaderTag(_FILECOLORS, "FILECOLORS");
-   public static final int _FILECLASS = 1141;
-   public static final RPMHeaderTag FILECLASS = new RPMHeaderTag(_FILECLASS, "FILECLASS");
-   public static final int _CLASSDICT = 1142;
-   public static final RPMHeaderTag CLASSDICT = new RPMHeaderTag(_CLASSDICT, "CLASSDICT");
-   public static final int _FILEDEPENDSX = 1143;
-   public static final RPMHeaderTag FILEDEPENDSX = new RPMHeaderTag(_FILEDEPENDSX, "FILEDEPENDSX");
-   public static final int _FILEDEPENDSN = 1144;
-   public static final RPMHeaderTag FILEDEPENDSN = new RPMHeaderTag(_FILEDEPENDSN, "FILEDEPENDSN");
-   public static final int _DEPENDSDICT = 1145;
-   public static final RPMHeaderTag DEPENDSDICT = new RPMHeaderTag(_DEPENDSDICT, "DEPENDSDICT");
-   public static final int _SOURCEPKGID = 1146;
-   public static final RPMHeaderTag SOURCEPKGID = new RPMHeaderTag(_SOURCEPKGID, "SOURCEPKGID");
+    public static final RPMHeaderTag UNKNOWN = new RPMHeaderTag(_UNKNOWN,
+	    "UNKNOWN");
 
-   // special strings (TODO find out id if available)
-   public static final RPMHeaderTag MULTILIBS = new RPMHeaderTag(10000, "MULTILIBS");
-   public static final RPMHeaderTag FSSIZES = new RPMHeaderTag(10001, "FSSIZES");
-   public static final RPMHeaderTag FSNAMES = new RPMHeaderTag(10002, "FSNAMES");
-   public static final RPMHeaderTag FILENAMES = new RPMHeaderTag(10003, "FILENAMES");
-   public static final RPMHeaderTag TRIGGERCONDS = new RPMHeaderTag(10004, "TRIGGERCONDS");
-   public static final RPMHeaderTag TRIGGERTYPE = new RPMHeaderTag(10005, "TRIGGERTYPE");
+    public static final int _HEADERIMAGE = 61;
 
-   private EnumIf delegate;
+    public static final RPMHeaderTag HEADERIMAGE = new RPMHeaderTag(
+	    _HEADERIMAGE, "HEADERIMAGE");
 
-   private RPMHeaderTag(int tag, String name) {
-      delegate = new EnumDelegate(RPMHeaderTag.class, tag, name, this);
-   }
+    public static final int _HEADERSIGNATURES = 62;
 
-   /**
-    * Get a enum by id
-    *
-    * @param id The id of the enum
-    * @return The enum object
-    */
-   public static EnumIf getEnumById(long id) {
-      return EnumDelegate.getEnumById(RPMHeaderTag.class, id);
-   }
+    public static final RPMHeaderTag HEADERSIGNATURES = new RPMHeaderTag(
+	    _HEADERSIGNATURES, "HEADERSIGNATURES");
 
-   /**
-    * Get a enum by name
-    *
-    * @param name The name of the enum
-    * @return The enum object
-    */
-   public static EnumIf getEnumByName(String name) {
-      return EnumDelegate.getEnumByName(RPMHeaderTag.class, name);
-   }
+    public static final int _HEADERIMMUTABLE = 63;
 
-   /**
-    * Get all defined enums of this class
-    *
-    * @return An array of all defined enum objects
-    */
-   public static String[] getEnumNames() {
-      return EnumDelegate.getEnumNames(RPMHeaderTag.class);
-   }
+    public static final RPMHeaderTag HEADERIMMUTABLE = new RPMHeaderTag(
+	    _HEADERIMMUTABLE, "HEADERIMMUTABLE");
 
-   /**
-    * Get a enum of this class by id
-    *
-    * @param tag The id
-    * @return The enum object
-    */
-   public static RPMHeaderTag getRPMHeaderTag(int tag) {
-      return (RPMHeaderTag) getEnumById(tag);
-   }
+    public static final int _HEADERREGIONS = 64;
 
-   /**
-    * Check if this enum class contains a enum of a specified id
-    *
-    * @param id The id of the enum
-    * @return TRUE if the enum is defined in this class
-    */
-   public static boolean containsEnumId(Long id) {
-      return EnumDelegate.containsEnumId(RPMHeaderTag.class, id);
-   }
+    public static final RPMHeaderTag HEADERREGIONS = new RPMHeaderTag(
+	    _HEADERREGIONS, "HEADERREGIONS");
 
-   /*
-    * @see com.jguild.jrpm.io.constant.EnumIf#getId()
-    */
-   public long getId() {
-      return delegate.getId();
-   }
+    public static final int _HEADERI18NTABLE = 100;
 
-   /*
-    * @see com.jguild.jrpm.io.constant.EnumIf#getName()
-    */
-   public String getName() {
-      return delegate.getName();
-   }
+    public static final RPMHeaderTag HEADERI18NTABLE = new RPMHeaderTag(
+	    _HEADERI18NTABLE, "HEADERI18NTABLE");
 
-   /*
-    * @see java.lang.Object#toString()
-    */
-   public String toString() {
-      return delegate.toString();
-   }
+    public static final int _SIG_BASE = 256;
+
+    public static final RPMHeaderTag SIG_BASE = new RPMHeaderTag(_SIG_BASE,
+	    "SIG_BASE");
+
+    public static final int _SIGSIZE = _SIG_BASE + 1;
+
+    public static final RPMHeaderTag SIGSIZE = new RPMHeaderTag(_SIGSIZE,
+	    "SIGSIZE");
+
+    public static final int _SIGLEMD5_1 = _SIG_BASE + 2;
+
+    public static final RPMHeaderTag SIGLEMD5_1 = new RPMHeaderTag(_SIGLEMD5_1,
+	    "SIGLEMD5_1");
+
+    public static final int _SIGPGP = _SIG_BASE + 3;
+
+    public static final RPMHeaderTag SIGPGP = new RPMHeaderTag(_SIGPGP,
+	    "SIGPGP");
+
+    public static final int _SIGLEMD5_2 = _SIG_BASE + 4;
+
+    public static final RPMHeaderTag SIGLEMD5_2 = new RPMHeaderTag(_SIGLEMD5_2,
+	    "SIGLEMD5_2");
+
+    public static final int _SIGMD5 = _SIG_BASE + 5;
+
+    public static final RPMHeaderTag SIGMD5 = new RPMHeaderTag(_SIGMD5,
+	    "SIGMD5");
+
+    public static final RPMHeaderTag PKGID = new RPMHeaderTag(_SIGMD5, "PKGID");
+
+    public static final int _SIGGPG = _SIG_BASE + 6;
+
+    public static final RPMHeaderTag SIGGPG = new RPMHeaderTag(_SIGGPG,
+	    "SIGGPG");
+
+    public static final int _SIGPGP5 = _SIG_BASE + 7;
+
+    public static final RPMHeaderTag SIGPGP5 = new RPMHeaderTag(_SIGPGP5,
+	    "SIGPGP5");
+
+    public static final int _BADSHA1_1 = _SIG_BASE + 8;
+
+    public static final RPMHeaderTag BADSHA1_1 = new RPMHeaderTag(_BADSHA1_1,
+	    "BADSHA1_1");
+
+    public static final int _BADSHA1_2 = _SIG_BASE + 9;
+
+    public static final RPMHeaderTag BADSHA1_2 = new RPMHeaderTag(_BADSHA1_2,
+	    "BADSHA1_2");
+
+    public static final int _PUBKEYS = _SIG_BASE + 10;
+
+    public static final RPMHeaderTag PUBKEYS = new RPMHeaderTag(_PUBKEYS,
+	    "PUBKEYS");
+
+    public static final int _DSAHEADER = _SIG_BASE + 11;
+
+    public static final RPMHeaderTag DSAHEADER = new RPMHeaderTag(_DSAHEADER,
+	    "DSAHEADER");
+
+    public static final int _RSAHEADER = _SIG_BASE + 12;
+
+    public static final RPMHeaderTag RSAHEADER = new RPMHeaderTag(_RSAHEADER,
+	    "RSAHEADER");
+
+    public static final int _SHA1HEADER = _SIG_BASE + 13;
+
+    public static final RPMHeaderTag SHA1HEADER = new RPMHeaderTag(_SHA1HEADER,
+	    "SHA1HEADER");
+
+    public static final RPMHeaderTag HDRID = new RPMHeaderTag(_SHA1HEADER,
+	    "HDRID");
+
+    public static final int _NAME = 1000;
+
+    public static final RPMHeaderTag NAME = new RPMHeaderTag(_NAME, "NAME");
+
+    public static final RPMHeaderTag N = new RPMHeaderTag(_NAME, "N");
+
+    public static final int _VERSION = 1001;
+
+    public static final RPMHeaderTag VERSION = new RPMHeaderTag(_VERSION,
+	    "VERSION");
+
+    public static final RPMHeaderTag V = new RPMHeaderTag(_VERSION, "V");
+
+    public static final int _RELEASE = 1002;
+
+    public static final RPMHeaderTag RELEASE = new RPMHeaderTag(_RELEASE,
+	    "RELEASE");
+
+    public static final RPMHeaderTag R = new RPMHeaderTag(_RELEASE, "R");
+
+    public static final int _EPOCH = 1003;
+
+    public static final RPMHeaderTag EPOCH = new RPMHeaderTag(_EPOCH, "EPOCH");
+
+    public static final RPMHeaderTag E = new RPMHeaderTag(_EPOCH, "E");
+
+    /* backward comaptibility */
+    public static final RPMHeaderTag SERIAL = new RPMHeaderTag(_EPOCH, "SERIAL");
+
+    public static final int _SUMMARY = 1004;
+
+    public static final RPMHeaderTag SUMMARY = new RPMHeaderTag(_SUMMARY,
+	    "SUMMARY");
+
+    public static final int _DESCRIPTION = 1005;
+
+    public static final RPMHeaderTag DESCRIPTION = new RPMHeaderTag(
+	    _DESCRIPTION, "DESCRIPTION");
+
+    public static final int _BUILDTIME = 1006;
+
+    public static final RPMHeaderTag BUILDTIME = new RPMHeaderTag(_BUILDTIME,
+	    "BUILDTIME");
+
+    public static final int _BUILDHOST = 1007;
+
+    public static final RPMHeaderTag BUILDHOST = new RPMHeaderTag(_BUILDHOST,
+	    "BUILDHOST");
+
+    public static final int _INSTALLTIME = 1008;
+
+    public static final RPMHeaderTag INSTALLTIME = new RPMHeaderTag(
+	    _INSTALLTIME, "INSTALLTIME");
+
+    public static final int _SIZE = 1009;
+
+    public static final RPMHeaderTag SIZE = new RPMHeaderTag(_SIZE, "SIZE");
+
+    public static final int _DISTRIBUTION = 1010;
+
+    public static final RPMHeaderTag DISTRIBUTION = new RPMHeaderTag(
+	    _DISTRIBUTION, "DISTRIBUTION");
+
+    public static final int _VENDOR = 1011;
+
+    public static final RPMHeaderTag VENDOR = new RPMHeaderTag(_VENDOR,
+	    "VENDOR");
+
+    public static final int _GIF = 1012;
+
+    public static final RPMHeaderTag GIF = new RPMHeaderTag(_GIF, "GIF");
+
+    public static final int _XPM = 1013;
+
+    public static final RPMHeaderTag XPM = new RPMHeaderTag(_XPM, "XPM");
+
+    public static final int _LICENSE = 1014;
+
+    public static final RPMHeaderTag LICENSE = new RPMHeaderTag(_LICENSE,
+	    "LICENSE");
+
+    /* backward comaptibility */
+    public static final RPMHeaderTag COPYRIGHT = new RPMHeaderTag(_LICENSE,
+	    "COPYRIGHT");
+
+    public static final int _PACKAGER = 1015;
+
+    public static final RPMHeaderTag PACKAGER = new RPMHeaderTag(_PACKAGER,
+	    "PACKAGER");
+
+    public static final int _GROUP = 1016;
+
+    public static final RPMHeaderTag GROUP = new RPMHeaderTag(_GROUP, "GROUP");
+
+    public static final int _CHANGELOG = 1017;
+
+    public static final RPMHeaderTag CHANGELOG = new RPMHeaderTag(_CHANGELOG,
+	    "CHANGELOG");
+
+    public static final int _SOURCE = 1018;
+
+    public static final RPMHeaderTag SOURCE = new RPMHeaderTag(_SOURCE,
+	    "SOURCE");
+
+    public static final int _PATCH = 1019;
+
+    public static final RPMHeaderTag PATCH = new RPMHeaderTag(_PATCH, "PATCH");
+
+    public static final int _URL = 1020;
+
+    public static final RPMHeaderTag URL = new RPMHeaderTag(_URL, "URL");
+
+    public static final int _OS = 1021;
+
+    public static final RPMHeaderTag OS = new RPMHeaderTag(_OS, "OS");
+
+    public static final int _ARCH = 1022;
+
+    public static final RPMHeaderTag ARCH = new RPMHeaderTag(_ARCH, "ARCH");
+
+    public static final int _PREIN = 1023;
+
+    public static final RPMHeaderTag PREIN = new RPMHeaderTag(_PREIN, "PREIN");
+
+    public static final int _POSTIN = 1024;
+
+    public static final RPMHeaderTag POSTIN = new RPMHeaderTag(_POSTIN,
+	    "POSTIN");
+
+    public static final int _PREUN = 1025;
+
+    public static final RPMHeaderTag PREUN = new RPMHeaderTag(_PREUN, "PREUN");
+
+    public static final int _POSTUN = 1026;
+
+    public static final RPMHeaderTag POSTUN = new RPMHeaderTag(_POSTUN,
+	    "POSTUN");
+
+    public static final int _OLDFILENAMES = 1027;
+
+    public static final RPMHeaderTag OLDFILENAMES = new RPMHeaderTag(
+	    _OLDFILENAMES, "OLDFILENAMES");
+
+    public static final int _FILESIZES = 1028;
+
+    public static final RPMHeaderTag FILESIZES = new RPMHeaderTag(_FILESIZES,
+	    "FILESIZES");
+
+    public static final int _FILESTATES = 1029;
+
+    public static final RPMHeaderTag FILESTATES = new RPMHeaderTag(_FILESTATES,
+	    "FILESTATES");
+
+    public static final int _FILEMODES = 1030;
+
+    public static final RPMHeaderTag FILEMODES = new RPMHeaderTag(_FILEMODES,
+	    "FILEMODES");
+
+    public static final int _FILEUIDS = 1031;
+
+    public static final RPMHeaderTag FILEUIDS = new RPMHeaderTag(_FILEUIDS,
+	    "FILEUIDS");
+
+    public static final int _FILEGIDS = 1032;
+
+    public static final RPMHeaderTag FILEGIDS = new RPMHeaderTag(_FILEGIDS,
+	    "FILEGIDS");
+
+    public static final int _FILERDEVS = 1033;
+
+    public static final RPMHeaderTag FILERDEVS = new RPMHeaderTag(_FILERDEVS,
+	    "FILERDEVS");
+
+    public static final int _FILEMTIMES = 1034;
+
+    public static final RPMHeaderTag FILEMTIMES = new RPMHeaderTag(_FILEMTIMES,
+	    "FILEMTIMES");
+
+    public static final int _FILEMD5S = 1035;
+
+    public static final RPMHeaderTag FILEMD5S = new RPMHeaderTag(_FILEMD5S,
+	    "FILEMD5S");
+
+    public static final int _FILELINKTOS = 1036;
+
+    public static final RPMHeaderTag FILELINKTOS = new RPMHeaderTag(
+	    _FILELINKTOS, "FILELINKTOS");
+
+    public static final int _FILEFLAGS = 1037;
+
+    public static final RPMHeaderTag FILEFLAGS = new RPMHeaderTag(_FILEFLAGS,
+	    "FILEFLAGS");
+
+    public static final int _ROOT = 1038;
+
+    public static final RPMHeaderTag ROOT = new RPMHeaderTag(_ROOT, "ROOT");
+
+    public static final int _FILEUSERNAME = 1039;
+
+    public static final RPMHeaderTag FILEUSERNAME = new RPMHeaderTag(
+	    _FILEUSERNAME, "FILEUSERNAME");
+
+    public static final int _FILEGROUPNAME = 1040;
+
+    public static final RPMHeaderTag FILEGROUPNAME = new RPMHeaderTag(
+	    _FILEGROUPNAME, "FILEGROUPNAME");
+
+    public static final int _EXCLUDE = 1041;
+
+    public static final RPMHeaderTag EXCLUDE = new RPMHeaderTag(_EXCLUDE,
+	    "EXCLUDE");
+
+    public static final int _EXCLUSIVE = 1042;
+
+    public static final RPMHeaderTag EXCLUSIVE = new RPMHeaderTag(_EXCLUSIVE,
+	    "EXCLUSIVE");
+
+    public static final int _ICON = 1043;
+
+    public static final RPMHeaderTag ICON = new RPMHeaderTag(_ICON, "ICON");
+
+    public static final int _SOURCERPM = 1044;
+
+    public static final RPMHeaderTag SOURCERPM = new RPMHeaderTag(_SOURCERPM,
+	    "SOURCERPM");
+
+    public static final int _FILEVERIFYFLAGS = 1045;
+
+    public static final RPMHeaderTag FILEVERIFYFLAGS = new RPMHeaderTag(
+	    _FILEVERIFYFLAGS, "FILEVERIFYFLAGS");
+
+    public static final int _ARCHIVESIZE = 1046;
+
+    public static final RPMHeaderTag ARCHIVESIZE = new RPMHeaderTag(
+	    _ARCHIVESIZE, "ARCHIVESIZE");
+
+    public static final int _PROVIDENAME = 1047;
+
+    public static final RPMHeaderTag PROVIDENAME = new RPMHeaderTag(
+	    _PROVIDENAME, "PROVIDENAME");
+
+    /* backward comaptibility */
+    public static final RPMHeaderTag PROVIDES = new RPMHeaderTag(_PROVIDENAME,
+	    "PROVIDES");
+
+    public static final int _REQUIREFLAGS = 1048;
+
+    public static final RPMHeaderTag REQUIREFLAGS = new RPMHeaderTag(
+	    _REQUIREFLAGS, "REQUIREFLAGS");
+
+    public static final int _REQUIRENAME = 1049;
+
+    public static final RPMHeaderTag REQUIRENAME = new RPMHeaderTag(
+	    _REQUIRENAME, "REQUIRENAME");
+
+    public static final int _REQUIREVERSION = 1050;
+
+    public static final RPMHeaderTag REQUIREVERSION = new RPMHeaderTag(
+	    _REQUIREVERSION, "REQUIREVERSION");
+
+    public static final int _NOSOURCE = 1051;
+
+    public static final RPMHeaderTag NOSOURCE = new RPMHeaderTag(_NOSOURCE,
+	    "NOSOURCE");
+
+    public static final int _NOPATCH = 1052;
+
+    public static final RPMHeaderTag NOPATCH = new RPMHeaderTag(_NOPATCH,
+	    "NOPATCH");
+
+    public static final int _CONFLICTFLAGS = 1053;
+
+    public static final RPMHeaderTag CONFLICTFLAGS = new RPMHeaderTag(
+	    _CONFLICTFLAGS, "CONFLICTFLAGS");
+
+    public static final int _CONFLICTNAME = 1054;
+
+    public static final RPMHeaderTag CONFLICTNAME = new RPMHeaderTag(
+	    _CONFLICTNAME, "CONFLICTNAME");
+
+    public static final int _CONFLICTVERSION = 1055;
+
+    public static final RPMHeaderTag CONFLICTVERSION = new RPMHeaderTag(
+	    _CONFLICTVERSION, "CONFLICTVERSION");
+
+    public static final int _DEFAULTPREFIX = 1056;
+
+    public static final RPMHeaderTag DEFAULTPREFIX = new RPMHeaderTag(
+	    _DEFAULTPREFIX, "DEFAULTPREFIX");
+
+    public static final int _BUILDROOT = 1057;
+
+    public static final RPMHeaderTag BUILDROOT = new RPMHeaderTag(_BUILDROOT,
+	    "BUILDROOT");
+
+    public static final int _INSTALLPREFIX = 1058;
+
+    public static final RPMHeaderTag INSTALLPREFIX = new RPMHeaderTag(
+	    _INSTALLPREFIX, "INSTALLPREFIX");
+
+    public static final int _EXCLUDEARCH = 1059;
+
+    public static final RPMHeaderTag EXCLUDEARCH = new RPMHeaderTag(
+	    _EXCLUDEARCH, "EXCLUDEARCH");
+
+    public static final int _EXCLUDEOS = 1060;
+
+    public static final RPMHeaderTag EXCLUDEOS = new RPMHeaderTag(_EXCLUDEOS,
+	    "EXCLUDEOS");
+
+    public static final int _EXCLUSIVEARCH = 1061;
+
+    public static final RPMHeaderTag EXCLUSIVEARCH = new RPMHeaderTag(
+	    _EXCLUSIVEARCH, "EXCLUSIVEARCH");
+
+    public static final int _EXCLUSIVEOS = 1062;
+
+    public static final RPMHeaderTag EXCLUSIVEOS = new RPMHeaderTag(
+	    _EXCLUSIVEOS, "EXCLUSIVEOS");
+
+    public static final int _AUTOREQPROV = 1063;
+
+    public static final RPMHeaderTag AUTOREQPROV = new RPMHeaderTag(
+	    _AUTOREQPROV, "AUTOREQPROV");
+
+    public static final int _RPMVERSION = 1064;
+
+    public static final RPMHeaderTag RPMVERSION = new RPMHeaderTag(_RPMVERSION,
+	    "RPMVERSION");
+
+    public static final int _TRIGGERSCRIPTS = 1065;
+
+    public static final RPMHeaderTag TRIGGERSCRIPT = new RPMHeaderTag(
+	    _TRIGGERSCRIPTS, "TRIGGERSCRIPTS");
+
+    public static final int _TRIGGERNAME = 1066;
+
+    public static final RPMHeaderTag TRIGGERNAME = new RPMHeaderTag(
+	    _TRIGGERNAME, "TRIGGERNAME");
+
+    public static final int _TRIGGERVERSION = 1067;
+
+    public static final RPMHeaderTag TRIGGERVERSION = new RPMHeaderTag(
+	    _TRIGGERVERSION, "TRIGGERVERSION");
+
+    public static final int _TRIGGERFLAGS = 1068;
+
+    public static final RPMHeaderTag TRIGGERFLAGS = new RPMHeaderTag(
+	    _TRIGGERFLAGS, "TRIGGERFLAGS");
+
+    public static final int _TRIGGERINDEX = 1069;
+
+    public static final RPMHeaderTag TRIGGERINDEX = new RPMHeaderTag(
+	    _TRIGGERINDEX, "TRIGGERINDEX");
+
+    public static final int _VERIFYSCRIPT = 1079;
+
+    public static final RPMHeaderTag VERIFYSCRIPT = new RPMHeaderTag(
+	    _VERIFYSCRIPT, "VERIFYSCRIPT");
+
+    public static final int _CHANGELOGTIME = 1080;
+
+    public static final RPMHeaderTag CHANGELOGTIME = new RPMHeaderTag(
+	    _CHANGELOGTIME, "CHANGELOGTIME");
+
+    public static final int _CHANGELOGNAME = 1081;
+
+    public static final RPMHeaderTag CHANGELOGNAME = new RPMHeaderTag(
+	    _CHANGELOGNAME, "CHANGELOGNAME");
+
+    public static final int _CHANGELOGTEXT = 1082;
+
+    public static final RPMHeaderTag CHANGELOGTEXT = new RPMHeaderTag(
+	    _CHANGELOGTEXT, "CHANGELOGTEXT");
+
+    public static final int _BROKENMD5 = 1083;
+
+    public static final RPMHeaderTag BROKENMD5 = new RPMHeaderTag(_BROKENMD5,
+	    "BROKENMD5");
+
+    public static final int _PREREQ = 1084;
+
+    public static final RPMHeaderTag PREREQ = new RPMHeaderTag(_PREREQ,
+	    "PREREQ");
+
+    public static final int _PREINPROG = 1085;
+
+    public static final RPMHeaderTag PREINPROG = new RPMHeaderTag(_PREINPROG,
+	    "PREINPROG");
+
+    public static final int _POSTINPROG = 1086;
+
+    public static final RPMHeaderTag POSTINPROG = new RPMHeaderTag(_POSTINPROG,
+	    "POSTINPROG");
+
+    public static final int _PREUNPROG = 1087;
+
+    public static final RPMHeaderTag PREUNPROG = new RPMHeaderTag(_PREUNPROG,
+	    "PREUNPROG");
+
+    public static final int _POSTUNPROG = 1088;
+
+    public static final RPMHeaderTag POSTUNPROG = new RPMHeaderTag(_POSTUNPROG,
+	    "POSTUNPROG");
+
+    public static final int _BUILDARCHS = 1089;
+
+    public static final RPMHeaderTag BUILDARCHS = new RPMHeaderTag(_BUILDARCHS,
+	    "BUILDARCHS");
+
+    public static final int _OBSOLETENAME = 1090;
+
+    public static final RPMHeaderTag OBSOLETENAME = new RPMHeaderTag(
+	    _OBSOLETENAME, "OBSOLETENAME");
+
+    /* backward comaptibility */
+    public static final RPMHeaderTag OBSOLETES = new RPMHeaderTag(
+	    _OBSOLETENAME, "OBSOLETES");
+
+    public static final int _VERIFYSCRIPTPROG = 1091;
+
+    public static final RPMHeaderTag VERIFYSCRIPTPROG = new RPMHeaderTag(
+	    _VERIFYSCRIPTPROG, "VERIFYSCRIPTPROG");
+
+    public static final int _TRIGGERSCRIPTPROG = 1092;
+
+    public static final RPMHeaderTag TRIGGERSCRIPTPROG = new RPMHeaderTag(
+	    _TRIGGERSCRIPTPROG, "TRIGGERSCRIPTPROG");
+
+    public static final int _DOCDIR = 1093;
+
+    public static final RPMHeaderTag DOCDIR = new RPMHeaderTag(_DOCDIR,
+	    "DOCDIR");
+
+    public static final int _COOKIE = 1094;
+
+    public static final RPMHeaderTag COOKIE = new RPMHeaderTag(_COOKIE,
+	    "COOKIE");
+
+    public static final int _FILEDEVICES = 1095;
+
+    public static final RPMHeaderTag FILEDEVICES = new RPMHeaderTag(
+	    _FILEDEVICES, "FILEDEVICES");
+
+    public static final int _FILEINODES = 1096;
+
+    public static final RPMHeaderTag FILEINODES = new RPMHeaderTag(_FILEINODES,
+	    "FILEINODES");
+
+    public static final int _FILELANGS = 1097;
+
+    public static final RPMHeaderTag FILELANGS = new RPMHeaderTag(_FILELANGS,
+	    "FILELANGS");
+
+    public static final int _PREFIXES = 1098;
+
+    public static final RPMHeaderTag PREFIXES = new RPMHeaderTag(_PREFIXES,
+	    "PREFIXES");
+
+    public static final int _INSTPREFIXES = 1099;
+
+    public static final RPMHeaderTag INSTPREFIXES = new RPMHeaderTag(
+	    _INSTPREFIXES, "INSTPREFIXES");
+
+    public static final int _TRIGGERIN = 1100;
+
+    public static final RPMHeaderTag TRIGGERIN = new RPMHeaderTag(_TRIGGERIN,
+	    "TRIGGERIN");
+
+    public static final int _TRIGGERUN = 1101;
+
+    public static final RPMHeaderTag TRIGGERUN = new RPMHeaderTag(_TRIGGERUN,
+	    "TRIGGERUN");
+
+    public static final int _TRIGGERPOSTUN = 1102;
+
+    public static final RPMHeaderTag TRIGGERPOSTUN = new RPMHeaderTag(
+	    _TRIGGERPOSTUN, "TRIGGERPOSTUN");
+
+    public static final int _AUTOREQ = 1103;
+
+    public static final RPMHeaderTag AUTOREQ = new RPMHeaderTag(_AUTOREQ,
+	    "AUTOREQ");
+
+    public static final int _AUTOPROV = 1104;
+
+    public static final RPMHeaderTag AUTOPROV = new RPMHeaderTag(_AUTOPROV,
+	    "AUTOPROV");
+
+    public static final int _CAPABILITY = 1105;
+
+    public static final RPMHeaderTag CAPABILITY = new RPMHeaderTag(_CAPABILITY,
+	    "CAPABILITY");
+
+    public static final int _SOURCEPACKAGE = 1106;
+
+    public static final RPMHeaderTag SOURCEPACKAGE = new RPMHeaderTag(
+	    _SOURCEPACKAGE, "SOURCEPACKAGE");
+
+    public static final int _OLDORIGFILENAMES = 1107;
+
+    public static final RPMHeaderTag OLDORIGFILENAMES = new RPMHeaderTag(
+	    _OLDORIGFILENAMES, "OLDORIGFILENAMES");
+
+    public static final int _BUILDPREREQ = 1108;
+
+    public static final RPMHeaderTag BUILDPREREQ = new RPMHeaderTag(
+	    _BUILDPREREQ, "BUILDPREREQ");
+
+    public static final int _BUILDREQUIRES = 1109;
+
+    public static final RPMHeaderTag BUILDREQUIRES = new RPMHeaderTag(
+	    _BUILDREQUIRES, "BUILDREQUIRES");
+
+    public static final int _BUILDCONFLICTS = 1110;
+
+    public static final RPMHeaderTag BUILDCONFLICTS = new RPMHeaderTag(
+	    _BUILDCONFLICTS, "BUILDCONFLICTS");
+
+    public static final int _BUILDMACROS = 1111;
+
+    public static final RPMHeaderTag BUILDMACROS = new RPMHeaderTag(
+	    _BUILDMACROS, "BUILDMACROS");
+
+    public static final int _PROVIDEFLAGS = 1112;
+
+    public static final RPMHeaderTag PROVIDEFLAGS = new RPMHeaderTag(
+	    _PROVIDEFLAGS, "PROVIDEFLAGS");
+
+    public static final int _PROVIDEVERSION = 1113;
+
+    public static final RPMHeaderTag PROVIDEVERSION = new RPMHeaderTag(
+	    _PROVIDEVERSION, "PROVIDEVERSION");
+
+    public static final int _OBSOLETEFLAGS = 1114;
+
+    public static final RPMHeaderTag OBSOLETEFLAGS = new RPMHeaderTag(
+	    _OBSOLETEFLAGS, "OBSOLETEFLAGS");
+
+    public static final int _OBSOLETEVERSION = 1115;
+
+    public static final RPMHeaderTag OBSOLETEVERSION = new RPMHeaderTag(
+	    _OBSOLETEVERSION, "OBSOLETEVERSION");
+
+    public static final int _DIRINDEXES = 1116;
+
+    public static final RPMHeaderTag DIRINDEXES = new RPMHeaderTag(_DIRINDEXES,
+	    "DIRINDEXES");
+
+    public static final int _BASENAMES = 1117;
+
+    public static final RPMHeaderTag BASENAMES = new RPMHeaderTag(_BASENAMES,
+	    "BASENAMES");
+
+    public static final int _DIRNAMES = 1118;
+
+    public static final RPMHeaderTag DIRNAMES = new RPMHeaderTag(_DIRNAMES,
+	    "DIRNAMES");
+
+    public static final int _ORIGDIRINDEXES = 1119;
+
+    public static final RPMHeaderTag ORIGDIRINDEXES = new RPMHeaderTag(
+	    _ORIGDIRINDEXES, "ORIGDIRINDEXES");
+
+    public static final int _ORIGBASENAMES = 1120;
+
+    public static final RPMHeaderTag ORIGBASENAMES = new RPMHeaderTag(
+	    _ORIGBASENAMES, "ORIGBASENAMES");
+
+    public static final int _ORIGDIRNAMES = 1121;
+
+    public static final RPMHeaderTag ORIGDIRNAMES = new RPMHeaderTag(
+	    _ORIGDIRNAMES, "ORIGDIRNAMES");
+
+    public static final int _OPTFLAGS = 1122;
+
+    public static final RPMHeaderTag OPTFLAGS = new RPMHeaderTag(_OPTFLAGS,
+	    "OPTFLAGS");
+
+    public static final int _DISTURL = 1123;
+
+    public static final RPMHeaderTag DISTURL = new RPMHeaderTag(_DISTURL,
+	    "DISTURL");
+
+    public static final int _PAYLOADFORMAT = 1124;
+
+    public static final RPMHeaderTag PAYLOADFORMAT = new RPMHeaderTag(
+	    _PAYLOADFORMAT, "PAYLOADFORMAT");
+
+    public static final int _PAYLOADCOMPRESSOR = 1125;
+
+    public static final RPMHeaderTag PAYLOADCOMPRESSOR = new RPMHeaderTag(
+	    _PAYLOADCOMPRESSOR, "PAYLOADCOMPRESSOR");
+
+    public static final int _PAYLOADFLAGS = 1126;
+
+    public static final RPMHeaderTag PAYLOADFLAGS = new RPMHeaderTag(
+	    _PAYLOADFLAGS, "PAYLOADFLAGS");
+
+    public static final int _INSTALLCOLOR = 1127;
+
+    public static final RPMHeaderTag INSTALLCOLOR = new RPMHeaderTag(
+	    _INSTALLCOLOR, "INSTALLCOLOR");
+
+    public static final int _INSTALLTID = 1128;
+
+    public static final RPMHeaderTag INSTALLTID = new RPMHeaderTag(_INSTALLTID,
+	    "INSTALLTID");
+
+    public static final int _REMOVETID = 1129;
+
+    public static final RPMHeaderTag REMOVETID = new RPMHeaderTag(_REMOVETID,
+	    "REMOVETID");
+
+    public static final int _SHA1RHN = 1130;
+
+    public static final RPMHeaderTag SHA1RHN = new RPMHeaderTag(_SHA1RHN,
+	    "SHA1RHN");
+
+    public static final int _RHNPLATFORM = 1131;
+
+    public static final RPMHeaderTag RHNPLATFORM = new RPMHeaderTag(
+	    _RHNPLATFORM, "RHNPLATFORM");
+
+    public static final int _PLATFORM = 1132;
+
+    public static final RPMHeaderTag PLATFORM = new RPMHeaderTag(_PLATFORM,
+	    "PLATFORM");
+
+    public static final int _PATCHESNAME = 1133;
+
+    public static final RPMHeaderTag PATCHESNAME = new RPMHeaderTag(
+	    _PATCHESNAME, "PATCHESNAME");
+
+    public static final int _PATCHESFLAGS = 1134;
+
+    public static final RPMHeaderTag PATCHESFLAGS = new RPMHeaderTag(
+	    _PATCHESFLAGS, "PATCHESFLAGS");
+
+    public static final int _PATCHESVERSION = 1135;
+
+    public static final RPMHeaderTag PATCHESVERSION = new RPMHeaderTag(
+	    _PATCHESVERSION, "PATCHESVERSION");
+
+    public static final int _CACHECTIME = 1136;
+
+    public static final RPMHeaderTag CACHECTIME = new RPMHeaderTag(_CACHECTIME,
+	    "CACHECTIME");
+
+    public static final int _CACHEPKGPATH = 1137;
+
+    public static final RPMHeaderTag CACHEPKGPATH = new RPMHeaderTag(
+	    _CACHEPKGPATH, "CACHEPKGPATH");
+
+    public static final int _CACHEPKGSIZE = 1138;
+
+    public static final RPMHeaderTag CACHEPKGSIZE = new RPMHeaderTag(
+	    _CACHEPKGSIZE, "CACHEPKGSIZE");
+
+    public static final int _CACHEPKGMTIME = 1139;
+
+    public static final RPMHeaderTag CACHEPKGMTIME = new RPMHeaderTag(
+	    _CACHEPKGMTIME, "CACHEPKGMTIME");
+
+    public static final int _FILECOLORS = 1140;
+
+    public static final RPMHeaderTag FILECOLORS = new RPMHeaderTag(_FILECOLORS,
+	    "FILECOLORS");
+
+    public static final int _FILECLASS = 1141;
+
+    public static final RPMHeaderTag FILECLASS = new RPMHeaderTag(_FILECLASS,
+	    "FILECLASS");
+
+    public static final int _CLASSDICT = 1142;
+
+    public static final RPMHeaderTag CLASSDICT = new RPMHeaderTag(_CLASSDICT,
+	    "CLASSDICT");
+
+    public static final int _FILEDEPENDSX = 1143;
+
+    public static final RPMHeaderTag FILEDEPENDSX = new RPMHeaderTag(
+	    _FILEDEPENDSX, "FILEDEPENDSX");
+
+    public static final int _FILEDEPENDSN = 1144;
+
+    public static final RPMHeaderTag FILEDEPENDSN = new RPMHeaderTag(
+	    _FILEDEPENDSN, "FILEDEPENDSN");
+
+    public static final int _DEPENDSDICT = 1145;
+
+    public static final RPMHeaderTag DEPENDSDICT = new RPMHeaderTag(
+	    _DEPENDSDICT, "DEPENDSDICT");
+
+    public static final int _SOURCEPKGID = 1146;
+
+    public static final RPMHeaderTag SOURCEPKGID = new RPMHeaderTag(
+	    _SOURCEPKGID, "SOURCEPKGID");
+
+    public static final int _FILECONTEXTS = 1147;
+
+    public static final RPMHeaderTag FILECONTEXTS = new RPMHeaderTag(
+	    _FILECONTEXTS, "FILECONTEXTS");
+
+    public static final int _FSCONTEXTS = 1148;
+
+    public static final RPMHeaderTag FSCONTEXTS = new RPMHeaderTag(_FSCONTEXTS,
+	    "FSCONTEXTS");
+
+    public static final int _RECONTEXTS = 1149;
+
+    public static final RPMHeaderTag RECONTEXTS = new RPMHeaderTag(_RECONTEXTS,
+	    "RECONTEXTS");
+
+    public static final int _POLICIES = 1150;
+
+    public static final RPMHeaderTag POLICIES = new RPMHeaderTag(_POLICIES,
+	    "POLICIES");
+
+    public static final int _PRETRANS = 1151;
+
+    public static final RPMHeaderTag PRETRANS = new RPMHeaderTag(_PRETRANS,
+	    "PRETRANS");
+
+    public static final int _POSTTRANS = 1152;
+
+    public static final RPMHeaderTag POSTTRANS = new RPMHeaderTag(_POSTTRANS,
+	    "POSTTRANS");
+
+    public static final int _PRETRANSPROG = 1153;
+
+    public static final RPMHeaderTag PRETRANSPROG = new RPMHeaderTag(
+	    _PRETRANSPROG, "PRETRANSPROG");
+
+    public static final int _POSTTRANSPROG = 1154;
+
+    public static final RPMHeaderTag POSTTRANSPROG = new RPMHeaderTag(
+	    _POSTTRANSPROG, "POSTTRANSPROG");
+
+    public static final int _DISTTAG = 1155;
+
+    public static final RPMHeaderTag DISTTAG = new RPMHeaderTag(_DISTTAG,
+	    "DISTTAG");
+
+    public static final int _SUGGESTSNAME = 1156;
+
+    public static final RPMHeaderTag SUGGESTSNAME = new RPMHeaderTag(
+	    _SUGGESTSNAME, "SUGGESTSNAME");
+
+    public static final RPMHeaderTag SUGGESTS = new RPMHeaderTag(_SUGGESTSNAME,
+	    "SUGGESTS");
+
+    public static final int _SUGGESTSVERSION = 1157;
+
+    public static final RPMHeaderTag SUGGESTSVERSION = new RPMHeaderTag(
+	    _SUGGESTSVERSION, "SUGGESTSVERSION");
+
+    public static final int _SUGGESTSFLAGS = 1158;
+
+    public static final RPMHeaderTag SUGGESTSFLAGS = new RPMHeaderTag(
+	    _SUGGESTSFLAGS, "SUGGESTSFLAGS");
+
+    public static final int _ENHANCESNAME = 1159;
+
+    public static final RPMHeaderTag ENHANCESNAME = new RPMHeaderTag(
+	    _ENHANCESNAME, "ENHANCESNAME");
+
+    public static final RPMHeaderTag ENHANCES = new RPMHeaderTag(_ENHANCESNAME,
+	    "ENHANCES");
+
+    public static final int _ENHANCESVERSION = 1160;
+
+    public static final RPMHeaderTag ENHANCESVERSION = new RPMHeaderTag(
+	    _ENHANCESVERSION, "ENHANCESVERSION");
+
+    public static final int _ENHANCESFLAGS = 1161;
+
+    public static final RPMHeaderTag ENHANCESFLAGS = new RPMHeaderTag(
+	    _ENHANCESFLAGS, "ENHANCESFLAGS");
+
+    public static final int _PRIORITY = 1162;
+
+    public static final RPMHeaderTag PRIORITY = new RPMHeaderTag(_PRIORITY,
+	    "PRIORITY");
+
+    public static final int _CVSID = 1163;
+
+    public static final RPMHeaderTag CVSID = new RPMHeaderTag(_CVSID, "CVSID");
+
+    public static final RPMHeaderTag SVNID = new RPMHeaderTag(_CVSID, "SVNID");
+
+    public static final int _BLINKPKGID = 1164;
+
+    public static final RPMHeaderTag BLINKPKGID = new RPMHeaderTag(_BLINKPKGID,
+	    "BLINKPKGID");
+
+    public static final int _BLINKHDRID = 1165;
+
+    public static final RPMHeaderTag BLINKHDRID = new RPMHeaderTag(_BLINKHDRID,
+	    "BLINKHDRID");
+
+    public static final int _BLINKNEVRA = 1166;
+
+    public static final RPMHeaderTag BLINKNEVRA = new RPMHeaderTag(_BLINKNEVRA,
+	    "BLINKNEVRA");
+
+    public static final int _FLINKPKGID = 1167;
+
+    public static final RPMHeaderTag FLINKPKGID = new RPMHeaderTag(_FLINKPKGID,
+	    "FLINKPKGID");
+
+    public static final int _FLINKHDRID = 1168;
+
+    public static final RPMHeaderTag FLINKHDRID = new RPMHeaderTag(_FLINKHDRID,
+	    "FLINKHDRID");
+
+    public static final int _FLINKNEVRA = 1169;
+
+    public static final RPMHeaderTag FLINKNEVRA = new RPMHeaderTag(_FLINKNEVRA,
+	    "FLINKNEVRA");
+
+    public static final int _PACKAGEORIGIN = 1170;
+
+    public static final RPMHeaderTag PACKAGEORIGIN = new RPMHeaderTag(
+	    _PACKAGEORIGIN, "PACKAGEORIGIN");
+
+    public static final int _TRIGGERPREIN = 1171;
+
+    public static final RPMHeaderTag TRIGGERPREIN = new RPMHeaderTag(
+	    _TRIGGERPREIN, "TRIGGERPREIN");
+
+    public static final int _BUILDSUGGESTS = 1172;
+
+    public static final RPMHeaderTag BUILDSUGGESTS = new RPMHeaderTag(
+	    _BUILDSUGGESTS, "BUILDSUGGESTS");
+
+    public static final int _BUILDENHANCES = 1173;
+
+    public static final RPMHeaderTag BUILDENHANCES = new RPMHeaderTag(
+	    _BUILDENHANCES, "BUILDENHANCES");
+
+    public static final int _SCRIPTSTATES = 1174;
+
+    public static final RPMHeaderTag SCRIPTSTATES = new RPMHeaderTag(
+	    _SCRIPTSTATES, "SCRIPTSTATES");
+
+    public static final int _SCRIPTMETRICS = 1175;
+
+    public static final RPMHeaderTag SCRIPTMETRICS = new RPMHeaderTag(
+	    _SCRIPTMETRICS, "SCRIPTMETRICS");
+
+    public static final int _BUILDCPUCLOCK = 1176;
+
+    public static final RPMHeaderTag BUILDCPUCLOCK = new RPMHeaderTag(
+	    _BUILDCPUCLOCK, "BUILDCPUCLOCK");
+
+    public static final int _FILEDIGESTALGOS = 1177;
+
+    public static final RPMHeaderTag FILEDIGESTALGOS = new RPMHeaderTag(
+	    _FILEDIGESTALGOS, "FILEDIGESTALGOS");
+
+    public static final int _VARIANTS = 1178;
+
+    public static final RPMHeaderTag VARIANTS = new RPMHeaderTag(_VARIANTS,
+	    "VARIANTS");
+
+    public static final int _XMAJOR = 1179;
+
+    public static final RPMHeaderTag XMAJOR = new RPMHeaderTag(_XMAJOR,
+	    "XMAJOR");
+
+    public static final int _XMINOR = 1180;
+
+    public static final RPMHeaderTag XMINOR = new RPMHeaderTag(_XMINOR,
+	    "XMINOR");
+
+    public static final int _REPOTAG = 1181;
+
+    public static final RPMHeaderTag REPOTAG = new RPMHeaderTag(_REPOTAG,
+	    "REPOTAG");
+
+    public static final int _KEYWORDS = 1182;
+
+    public static final RPMHeaderTag KEYWORDS = new RPMHeaderTag(_KEYWORDS,
+	    "KEYWORDS");
+
+    public static final int _BUILDPLATFORMS = 1183;
+
+    public static final RPMHeaderTag BUILDPLATFORMS = new RPMHeaderTag(
+	    _BUILDPLATFORMS, "BUILDPLATFORMS");
+
+    public static final int _PACKAGECOLOR = 1184;
+
+    public static final RPMHeaderTag PACKAGECOLOR = new RPMHeaderTag(
+	    _PACKAGECOLOR, "PACKAGECOLOR");
+
+    public static final int _PACKAGEPREFCOLOR = 1185;
+
+    public static final RPMHeaderTag PACKAGEPREFCOLOR = new RPMHeaderTag(
+	    _PACKAGEPREFCOLOR, "PACKAGEPREFCOLOR");
+
+    public static final int _XATTRSDICT = 1186;
+
+    public static final RPMHeaderTag XATTRSDICT = new RPMHeaderTag(_XATTRSDICT,
+	    "XATTRSDICT");
+
+    public static final int _FILEXATTRSX = 1187;
+
+    public static final RPMHeaderTag FILEXATTRSX = new RPMHeaderTag(
+	    _FILEXATTRSX, "FILEXATTRSX");
+
+    public static final int _DEPATTRSDICT = 1188;
+
+    public static final RPMHeaderTag DEPATTRSDICT = new RPMHeaderTag(
+	    _DEPATTRSDICT, "DEPATTRSDICT");
+
+    public static final int _CONFLICTATTRSX = 1189;
+
+    public static final RPMHeaderTag CONFLICTATTRSX = new RPMHeaderTag(
+	    _CONFLICTATTRSX, "CONFLICTATTRSX");
+
+    public static final int _OBSOLETEATTRSX = 1190;
+
+    public static final RPMHeaderTag OBSOLETEATTRSX = new RPMHeaderTag(
+	    _OBSOLETEATTRSX, "OBSOLETEATTRSX");
+
+    public static final int _PROVIDEATTRSX = 1191;
+
+    public static final RPMHeaderTag PROVIDEATTRSX = new RPMHeaderTag(
+	    _PROVIDEATTRSX, "PROVIDEATTRSX");
+
+    public static final int _REQUIREATTRSX = 1192;
+
+    public static final RPMHeaderTag REQUIREATTRSX = new RPMHeaderTag(
+	    _REQUIREATTRSX, "REQUIREATTRSX");
+
+    public static final int _BUILDPROVIDES = 1193;
+
+    public static final RPMHeaderTag BUILDPROVIDES = new RPMHeaderTag(
+	    _BUILDPROVIDES, "BUILDPROVIDES");
+
+    public static final int _BUILDOBSOLETES = 1194;
+
+    public static final RPMHeaderTag BUILDOBSOLETES = new RPMHeaderTag(
+	    _BUILDOBSOLETES, "BUILDOBSOLETES");
+
+    public static final int _DBINSTANCE = 1195;
+
+    public static final RPMHeaderTag DBINSTANCE = new RPMHeaderTag(_DBINSTANCE,
+	    "DBINSTANCE");
+
+    public static final int _NVRA = 1196;
+
+    public static final RPMHeaderTag NVRA = new RPMHeaderTag(_NVRA, "NVRA");
+
+    public static final int _FILEPATHS = 1197;
+
+    public static final RPMHeaderTag FILEPATHS = new RPMHeaderTag(_FILEPATHS,
+	    "FILEPATHS");
+
+    public static final int _ORIGPATHS = 1198;
+
+    public static final RPMHeaderTag ORIGPATHS = new RPMHeaderTag(_ORIGPATHS,
+	    "ORIGPATHS");
+
+    public static final int _RPMLIBVERSION = 1199;
+
+    public static final RPMHeaderTag RPMLIBVERSION = new RPMHeaderTag(
+	    _RPMLIBVERSION, "RPMLIBVERSION");
+
+    public static final int _RPMLIBTIMESTAMP = 1200;
+
+    public static final RPMHeaderTag RPMLIBTIMESTAMP = new RPMHeaderTag(
+	    _RPMLIBTIMESTAMP, "RPMLIBTIMESTAMP");
+
+    public static final int _RPMLIBVENDOR = 1201;
+
+    public static final RPMHeaderTag RPMLIBVENDOR = new RPMHeaderTag(
+	    _RPMLIBVENDOR, "RPMLIBVENDOR");
+
+    public static final int _CLASS = 1202;
+
+    public static final RPMHeaderTag CLASS = new RPMHeaderTag(_CLASS, "CLASS");
+
+    public static final int _TRACK = 1203;
+
+    public static final RPMHeaderTag TRACK = new RPMHeaderTag(_TRACK, "TRACK");
+
+    public static final int _TRACKPROG = 1204;
+
+    public static final RPMHeaderTag TRACKPROG = new RPMHeaderTag(_TRACKPROG,
+	    "TRACKPROG");
+
+    public static final int _SANITYCHECK = 1205;
+
+    public static final RPMHeaderTag SANITYCHECK = new RPMHeaderTag(
+	    _SANITYCHECK, "SANITYCHECK");
+
+    public static final int _SANITYCHECKPROG = 1206;
+
+    public static final RPMHeaderTag SANITYCHECKPROG = new RPMHeaderTag(
+	    _SANITYCHECKPROG, "SANITYCHECKPROG");
+
+    public static final int _FILESTAT = 1207;
+
+    public static final RPMHeaderTag FILESTAT = new RPMHeaderTag(_FILESTAT,
+	    "FILESTAT");
+
+    public static final int _STAT = 1208;
+
+    public static final RPMHeaderTag STAT = new RPMHeaderTag(_STAT, "STAT");
+
+    public static final int _ORIGINTID = 1209;
+
+    public static final RPMHeaderTag ORIGINTID = new RPMHeaderTag(_ORIGINTID,
+	    "ORIGINTID");
+
+    public static final int _ORIGINTIME = 1210;
+
+    public static final RPMHeaderTag ORIGINTIME = new RPMHeaderTag(_ORIGINTIME,
+	    "ORIGINTIME");
+
+    public static final int _HEADERSTARTOFF = 1211;
+
+    public static final RPMHeaderTag HEADERSTARTOFF = new RPMHeaderTag(
+	    _HEADERSTARTOFF, "HEADERSTARTOFF");
+
+    public static final int _HEADERENDOFF = 1212;
+
+    public static final RPMHeaderTag HEADERENDOFF = new RPMHeaderTag(
+	    _HEADERENDOFF, "HEADERENDOFF");
+
+    public static final int _PACKAGETIME = 1213;
+
+    public static final RPMHeaderTag PACKAGETIME = new RPMHeaderTag(
+	    _PACKAGETIME, "PACKAGETIME");
+
+    public static final int _PACKAGESIZE = 1214;
+
+    public static final RPMHeaderTag PACKAGESIZE = new RPMHeaderTag(
+	    _PACKAGESIZE, "PACKAGESIZE");
+
+    public static final int _PACKAGEDIGEST = 1215;
+
+    public static final RPMHeaderTag PACKAGEDIGEST = new RPMHeaderTag(
+	    _PACKAGEDIGEST, "PACKAGEDIGEST");
+
+    public static final int _PACKAGESTAT = 1216;
+
+    public static final RPMHeaderTag PACKAGESTAT = new RPMHeaderTag(
+	    _PACKAGESTAT, "PACKAGESTAT");
+
+    public static final int _PACKAGEBASEURL = 1217;
+
+    public static final RPMHeaderTag PACKAGEBASEURL = new RPMHeaderTag(
+	    _PACKAGEBASEURL, "PACKAGEBASEURL");
+
+    // special strings (TODO find out id if available)
+    public static final RPMHeaderTag MULTILIBS = new RPMHeaderTag(10000,
+	    "MULTILIBS");
+
+    public static final RPMHeaderTag FSSIZES = new RPMHeaderTag(10001,
+	    "FSSIZES");
+
+    public static final RPMHeaderTag FSNAMES = new RPMHeaderTag(10002,
+	    "FSNAMES");
+
+    public static final RPMHeaderTag FILENAMES = new RPMHeaderTag(10003,
+	    "FILENAMES");
+
+    public static final RPMHeaderTag TRIGGERCONDS = new RPMHeaderTag(10004,
+	    "TRIGGERCONDS");
+
+    public static final RPMHeaderTag TRIGGERTYPE = new RPMHeaderTag(10005,
+	    "TRIGGERTYPE");
+
+    // jrpm flags
+    public static final RPMHeaderTag J_FILESIZE = new RPMHeaderTag(90000,
+	    "J_FILESIZE");
+
+    public static final RPMHeaderTag J_ARCHIVESIZE = new RPMHeaderTag(90001,
+	    "J_ARCHIVESIZE");
+
+    private EnumIf delegate;
+
+    private RPMHeaderTag(int tag, String name) {
+	delegate = new EnumDelegate(RPMHeaderTag.class, tag, name, this);
+    }
+
+    /**
+         * Get a enum by id
+         * 
+         * @param id
+         *                The id of the enum
+         * @return The enum object
+         */
+    public static EnumIf getEnumById(long id) {
+	return EnumDelegate.getEnumById(RPMHeaderTag.class, id);
+    }
+
+    /**
+         * Get a enum by name
+         * 
+         * @param name
+         *                The name of the enum
+         * @return The enum object
+         */
+    public static EnumIf getEnumByName(String name) {
+	return EnumDelegate.getEnumByName(RPMHeaderTag.class, name);
+    }
+
+    /**
+         * Get all defined enums of this class
+         * 
+         * @return An array of all defined enum objects
+         */
+    public static String[] getEnumNames() {
+	return EnumDelegate.getEnumNames(RPMHeaderTag.class);
+    }
+
+    /**
+         * Get a enum of this class by id
+         * 
+         * @param tag
+         *                The id
+         * @return The enum object
+         */
+    public static RPMHeaderTag getRPMHeaderTag(int tag) {
+	return (RPMHeaderTag) getEnumById(tag);
+    }
+
+    /**
+         * Check if this enum class contains a enum of a specified id
+         * 
+         * @param id
+         *                The id of the enum
+         * @return TRUE if the enum is defined in this class
+         */
+    public static boolean containsEnumId(Long id) {
+	return EnumDelegate.containsEnumId(RPMHeaderTag.class, id);
+    }
+
+    /*
+         * @see com.jguild.jrpm.io.constant.EnumIf#getId()
+         */
+    public long getId() {
+	return delegate.getId();
+    }
+
+    /*
+         * @see com.jguild.jrpm.io.constant.EnumIf#getName()
+         */
+    public String getName() {
+	return delegate.getName();
+    }
+
+    /*
+         * @see java.lang.Object#toString()
+         */
+    public String toString() {
+	return delegate.toString();
+    }
 }

Deleted: trunk/src/java/com/jguild/jrpm/io/constant/RPMSignatureTag.java
===================================================================
--- trunk/src/java/com/jguild/jrpm/io/constant/RPMSignatureTag.java	2008-04-20 17:14:01 UTC (rev 20)
+++ trunk/src/java/com/jguild/jrpm/io/constant/RPMSignatureTag.java	2008-06-19 00:35:46 UTC (rev 21)
@@ -1,118 +0,0 @@
-/*
- * jGuild Project: jRPM
- * Released under the Apache License ( http://www.apache.org/LICENSE )
- */
-package com.jguild.jrpm.io.constant;
-
-
-/**
- * Constants for signature tags.
- *
- * @version $Id: RPMSignatureTag.java,v 1.4 2004/05/06 20:59:24 mkuss Exp $
- */
-public final class RPMSignatureTag implements EnumIf {
-    public static final RPMSignatureTag UNKNOWN = new RPMSignatureTag(_UNKNOWN, "UNKNOWN");
-    public static final int _HEADERSIGNATURES = 62;
-    public static final RPMSignatureTag HEADERSIGNATURES = new RPMSignatureTag(_HEADERSIGNATURES, "HEADERSIGNATURES");
-    public static final int _BADSHA1_1 = 264;
-    public static final RPMSignatureTag BADSHA1_1 = new RPMSignatureTag(_BADSHA1_1, "BADSHA1_1");
-    public static final int _BADSHA1_2 = 265;
-    public static final RPMSignatureTag BADSHA1_2 = new RPMSignatureTag(_BADSHA1_2, "BADSHA1_2");
-    public static final int _DSA = 267;
-    public static final RPMSignatureTag DSA = new RPMSignatureTag(_DSA, "DSA");
-    public static final int _RSA = 268;
-    public static final RPMSignatureTag RSA = new RPMSignatureTag(_RSA, "RSA");
-    public static final int _SHA1 = 269;
-    public static final RPMSignatureTag SHA1 = new RPMSignatureTag(_SHA1, "SHA1");
-    public static final int _SIZE = 1000;
-    public static final RPMSignatureTag SIZE = new RPMSignatureTag(_SIZE, "SIZE");
-    public static final int _LEMD5_1 = 1001;
-    public static final RPMSignatureTag LEMD5_1 = new RPMSignatureTag(_LEMD5_1, "LEMD5_1");
-    public static final int _PGP = 1002;
-    public static final RPMSignatureTag PGP = new RPMSignatureTag(_PGP, "PGP");
-    public static final int _LEMD5_2 = 1003;
-    public static final RPMSignatureTag LEMD5_2 = new RPMSignatureTag(_LEMD5_2, "LEMD5_2");
-    public static final int _MD5 = 1004;
-    public static final RPMSignatureTag MD5 = new RPMSignatureTag(_MD5, "MD5");
-    public static final int _GPG = 1005;
-    public static final RPMSignatureTag GPG = new RPMSignatureTag(_GPG, "GPG");
-    public static final int _PGP5 = 1006;
-    public static final RPMSignatureTag PGP5 = new RPMSignatureTag(_PGP5, "PGP5");
-    public static final int _PAYLOADSIZE = 1007;
-    public static final RPMSignatureTag PAYLOADSIZE = new RPMSignatureTag(_PAYLOADSIZE, "PAYLOADSIZE");
-    private EnumIf delegate;
-
-    private RPMSignatureTag(int signature, String name) {
-        delegate = new EnumDelegate(RPMSignatureTag.class, signature, name, this);
-    }
-
-    /**
-     * Get a enum by id
-     *
-     * @param id The id of the enum
-     * @return The enum object
-     */
-    public static EnumIf getEnumById(long id) {
-        return EnumDelegate.getEnumById(RPMSignatureTag.class, id);
-    }
-
-    /**
-     * Get a enum by name
-     *
-     * @param name The name of the enum
-     * @return The enum object
-     */
-    public static EnumIf getEnumByName(String name) {
-        return EnumDelegate.getEnumByName(RPMSignatureTag.class, name);
-    }
-
-    /**
-     * Get all defined enums of this class
-     *
-     * @return An array of all defined enum objects
-     */
-    public static String[] getEnumNames() {
-        return EnumDelegate.getEnumNames(RPMSignatureTag.class);
-    }
-
-    /**
-     * Get a enum of this class by id
-     *
-     * @param signature The id
-     * @return The enum object
-     */
-    public static RPMSignatureTag getRPMSignatureTag(int signature) {
-        return (RPMSignatureTag) getEnumById(signature);
-    }
-
-    /**
-     * Check if this enum class contains a enum of a specified id
-     *
-     * @param id The id of the enum
-     * @return TRUE if the enum is defined in this class
-     */
-    public static boolean containsEnumId(Long id) {
-        return EnumDelegate.containsEnumId(RPMSignatureTag.class, id);
-    }
-
-    /*
-     * @see com.jguild.jrpm.io.constant.EnumIf#getId()
-     */
-    public long getId() {
-        return delegate.getId();
-    }
-
-    /*
-     * @see com.jguild.jrpm.io.constant.EnumIf#getName()
-     */
-    public String getName() {
-        return delegate.getName();
-    }
-
-    /*
-     * @see java.lang.Object#toString()
-     */
-    public String toString() {
-        return delegate.toString();
-    }
-}

Modified: trunk/src/java/com/jguild/jrpm/tools/Info.java
===================================================================
--- trunk/src/java/com/jguild/jrpm/tools/Info.java	2008-04-20 17:14:01 UTC (rev 20)
+++ trunk/src/java/com/jguild/jrpm/tools/Info.java	2008-06-19 00:35:46 UTC (rev 21)
@@ -1,9 +1,16 @@
 /*
- * Created on 02.04.2008
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
  *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ **/
 package com.jguild.jrpm.tools;
 
 import java.io.File;
@@ -13,120 +20,121 @@
 import com.jguild.jrpm.io.datatype.DataTypeIf;
 
 public class Info {
-	private static double kbs = 0;
+    private static double kbs = 0;
 
-	private static long start_base = 0;
+    private static long start_base = 0;
 
-	/**
-	 * @param args
-	 * @throws IOException
-	 */
-	public static void main(String[] args) {
-		File dir = new File(args[0]);
+    /**
+         * @param args
+         * @throws IOException
+         */
+    public static void main(String[] args) {
+	File dir = new File(args[0]);
 
-		start_base = System.currentTimeMillis();
+	start_base = System.currentTimeMillis();
 
-		scanFiles(dir.listFiles());
-		print("DONE ================================== ", 45, false);
-		print(getTime(System.currentTimeMillis() - start_base), 10, true);
-	}
+	scanFiles(dir.listFiles());
+	print("DONE ================================== ", 45, false);
+	print(getTime(System.currentTimeMillis() - start_base), 10, true);
+    }
 
-	/**
-	 * @param files
-	 */
-	private static void scanFiles(File[] files) {
-		for (int pos = 0; pos < files.length; pos++) {
-			if (files[pos].isDirectory()) {
-				scanFiles(files[pos].listFiles());
-				continue;
-			}
-			if (!files[pos].getName().endsWith(".rpm"))
-				continue;
+    /**
+         * @param files
+         */
+    private static void scanFiles(File[] files) {
+	for (int pos = 0; pos < files.length; pos++) {
+	    if (files[pos].isDirectory()) {
+		scanFiles(files[pos].listFiles());
+		continue;
+	    }
+	    if (!files[pos].getName().endsWith(".rpm"))
+		continue;
 
-			long start = System.currentTimeMillis();
-			try {
+	    long start = System.currentTimeMillis();
+	    try {
 
-				print(files[pos].getName(), 40, false);
-				RPMFile rpm = new RPMFile(files[pos]);
-				rpm.parse();
+		print(files[pos].getName(), 40, false);
+		RPMFile rpm = new RPMFile(files[pos]);
+		rpm.parse();
 
-				print(" ", 1, false);
-				print("OK!", 5, false);
-				print(" ", 1, false);
-				long time = System.currentTimeMillis() - start;
-				print(getTime(time++), 8, true);
-				print(" ", 1, false);
-				print(rpm.getTag("PAYLOADCOMPRESSOR"), 6, true);
-				print(" ", 1, false);
-				print(rpm.getTag("VENDOR"), 20, false);
-				print(" ", 1, false);
-				double kb = (files[pos].length() / 1024d);
-				kbs += kb;
-				print(Math.round(kb / (time / 1000d)) + " KB/s", 20, false);
-				print(Math.round(kbs
-						/ ((System.currentTimeMillis() - start_base) / 1000d))
-						+ " KB/s", 20, false);
-				System.out.println();
-			} catch (Exception e) {
-				print(" ", 1, false);
-				print("FAILED!", 10, false);
-				System.out.println();
-				e.printStackTrace(System.out);
-			}
-		}
+		print(" ", 1, false);
+		print("OK!", 5, false);
+		print(" ", 1, false);
+		long time = System.currentTimeMillis() - start;
+		print(getTime(time++), 8, true);
+		print(" ", 1, false);
+		print(rpm.getTag("PAYLOADCOMPRESSOR"), 6, true);
+		print(" ", 1, false);
+		print(rpm.getTag("VENDOR"), 20, false);
+		print(" ", 1, false);
+
+		double kb = (files[pos].length() / 1024d);
+		kbs += kb;
+		print(Math.round(kb / (time / 1000d)) + " KB/s", 20, false);
+		print(Math.round(kbs
+			/ ((System.currentTimeMillis() - start_base) / 1000d))
+			+ " KB/s", 20, false);
+		System.out.println();
+	    } catch (Exception e) {
+		print(" ", 1, false);
+		print("FAILED!", 10, false);
+		System.out.println();
+		e.printStackTrace(System.out);
+	    }
 	}
+    }
 
-	/**
-	 * @param tag
-	 * @param i
-	 * @param b
-	 */
-	private static void print(DataTypeIf tag, int i, boolean b) {
-		String str = "";
-		if (tag != null) {
-			str = tag.toString();
-		}
-		print(str, i, b);
+    /**
+         * @param tag
+         * @param i
+         * @param b
+         */
+    private static void print(DataTypeIf tag, int size, boolean right) {
+	String str = "";
+	if (tag != null) {
+	    str = tag.toString();
 	}
+	print(str, size, right);
+    }
 
-	/**
-	 * @param l
-	 * @return
-	 */
-	private static String getTime(long time) {
-		String einheit = "ms";
-		if (time > 2000) {
-			time /= 1000;
-			einheit = "s";
+    /**
+         * @param l
+         * @return
+         */
+    private static String getTime(long time) {
+	String einheit = "ms";
+	if (time > 2000) {
+	    time /= 1000;
+	    einheit = "s";
 
-			if (time > 120) {
-				time /= 60;
-				einheit = "m";
-			}
-		}
-		return time + " " + einheit;
+	    if (time > 120) {
+		time /= 60;
+		einheit = "m";
+	    }
 	}
+	return time + " " + einheit;
+    }
 
-	/**
-	 * @param string
-	 * @param i
-	 */
-	private static void print(String string, int size, boolean right) {
-		int length = string.length();
-		if (length > size) {
-			string = string.substring(0, size);
-		}
-		if (right) {
-			while (length++ < size) {
-				System.out.print(" ");
-			}
-		}
-		System.out.print(string);
+    /**
+         * @param string
+         * @param i
+         */
+    private static void print(String string, int size, boolean right) {
+	int length = string.length();
+	if (length > size) {
+	    string = string.substring(0, size);
+	}
+	if (right) {
+	    while (length++ < size) {
+		System.out.print(" ");
+	    }
+	}
+	System.out.print(string);
 
-		if (!right) {
-			while (length++ < size) {
-				System.out.print(" ");
-			}
-		}
+	if (!right) {
+	    while (length++ < size) {
+		System.out.print(" ");
+	    }
 	}
+    }
 }

Modified: trunk/src/test/com/jguild/jrpm/test/HeaderFileParsingTest.java
===================================================================
--- trunk/src/test/com/jguild/jrpm/test/HeaderFileParsingTest.java	2008-04-20 17:14:01 UTC (rev 20)
+++ trunk/src/test/com/jguild/jrpm/test/HeaderFileParsingTest.java	2008-06-19 00:35:46 UTC (rev 21)
@@ -4,14 +4,20 @@
  */
 package com.jguild.jrpm.test;
 
-import com.jguild.jrpm.io.RPMHeader;
-import junit.framework.TestCase;
-
-import java.io.*;
+import java.io.BufferedInputStream;
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
 import java.net.URL;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import junit.framework.TestCase;
+
+import com.jguild.jrpm.io.RPMHeader;
+import com.jguild.jrpm.io.Store;
+
 /**
  * Unit Test for parsing RPM files.
  */
@@ -19,32 +25,36 @@
     private static final Logger logger = Logger.getLogger("jrpm.test");
 
     /**
-     * Try to retrieve some tags of the defined test.rpm rpm file.
-     */
+         * Try to retrieve some tags of the defined test.rpm rpm file.
+         */
     public void testRPM() {
-        try {
-            String rpmFile = "glibc-2.3.3-47.i686.hdr";
-            File rpmFileReference = getTestRPMFile(rpmFile);
-            assertNotNull(rpmFileReference);
-            InputStream in = new BufferedInputStream(new FileInputStream(rpmFileReference));
-            RPMHeader hdr = new RPMHeader(new DataInputStream(in), true);
-            assertEquals("glibc", hdr.getTag("name").toString());
-        } catch (Throwable e) {
-            logger.log(Level.SEVERE, "Unexpected error", e);
-            fail(e.getLocalizedMessage());
-        }
+	try {
+	    String rpmFile = "glibc-2.3.3-47.i686.hdr";
+	    File rpmFileReference = getTestRPMFile(rpmFile);
+	    assertNotNull(rpmFileReference);
+	    InputStream in = new BufferedInputStream(new FileInputStream(
+		    rpmFileReference));
+	    Store store = new Store();
+	    RPMHeader hdr = new RPMHeader(new DataInputStream(in), true, store);
+	    assertEquals("glibc", store.getTag("name").toString());
+	} catch (Throwable e) {
+	    logger.log(Level.SEVERE, "Unexpected error", e);
+	    fail(e.getLocalizedMessage());
+	}
     }
 
     /**
-     * Find a resource in the classpath.
-     *
-     * @param name The resource name
-     * @return An input stream pointing to the resource
-     * @see ClassLoader#getResourceAsStream(String)
-     */
+         * Find a resource in the classpath.
+         * 
+         * @param name
+         *                The resource name
+         * @return An input stream pointing to the resource
+         * @see ClassLoader#getResourceAsStream(String)
+         */
     private File getTestRPMFile(String name) {
-        URL rpmUrl = HeaderFileParsingTest.class.getClassLoader().getResource(name);
-        System.out.println(rpmUrl);
-        return new File(rpmUrl.getFile());
+	URL rpmUrl = HeaderFileParsingTest.class.getClassLoader().getResource(
+		name);
+	System.out.println(rpmUrl);
+	return new File(rpmUrl.getFile());
     }
 }

Modified: trunk/src/test/com/jguild/jrpm/test/RPMFileParsingTest.java
===================================================================
--- trunk/src/test/com/jguild/jrpm/test/RPMFileParsingTest.java	2008-04-20 17:14:01 UTC (rev 20)
+++ trunk/src/test/com/jguild/jrpm/test/RPMFileParsingTest.java	2008-06-19 00:35:46 UTC (rev 21)
@@ -18,10 +18,6 @@
 public class RPMFileParsingTest extends TestCase {
     private static final Logger logger = Logger.getLogger("jrpm.test");
     private static final String[] RPM_FILES = {"ElectricFence-2.2.2-15.i386.rpm"};
-    private static final int[] TOTAL_SIG_TAGIDS = {7};
-    private static final int[] TOTAL_SIG_TAGNAMES = {7};
-    private static final int[] TOTAL_HEAD_TAGIDS = {75};
-    private static final int[] TOTAL_HEAD_TAGNAMES = {75};
     private static final String[] NAME = {"ElectricFence"};
     private static final String VENDOR_REDHAT = "Red Hat, Inc.";
     private static final String[] VENDOR = {VENDOR_REDHAT};
@@ -57,14 +53,6 @@
                 }
                 file.parse();
 
-                assertEquals(TOTAL_SIG_TAGIDS[i], file.getSignature()
-                        .getTagIds().length);
-                assertEquals(TOTAL_SIG_TAGNAMES[i], file.getSignature()
-                        .getTagNames().length);
-                assertEquals(TOTAL_HEAD_TAGIDS[i],
-                        file.getHeader().getTagIds().length);
-                assertEquals(TOTAL_HEAD_TAGNAMES[i], file.getHeader()
-                        .getTagNames().length);
                 assertEquals(NAME[i], file.getTag("name").toString());
                 assertEquals(VENDOR[i], file.getTag("vendor").toString());
                 assertEquals("cpio", file.getTag("PAYLOADFORMAT").toString());


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php