com.jguild.jrpm.io

Class IndexEntry

public class IndexEntry extends Object

RPM Index Entry (16 byte).

  1. tag; what the data is for (4 bytes)
  2. type; what type of data is stored (see RPMFileType.java) (4 bytes)
  3. offset; where to the data begins (4 bytes)
  4. count; how much data of the type is there (4 bytes)

Version: $Id: IndexEntry.java,v 1.5 2004/05/06 20:59:22 mkuss Exp $

Constructor Summary
IndexEntry(DataInputStream inputStream)
Constructs a IndexEntry out of a InputStream.
Method Summary
longgetCount()
Get the number of elements of this data type
longgetOffset()
Returns the offset of this data type
intgetSize()
Get the size of this index entry in bytes
longgetTag()
Get the tag id as a long
RPMIndexTypegetType()
Get the data type of this entry

Constructor Detail

IndexEntry

public IndexEntry(DataInputStream inputStream)
Constructs a IndexEntry out of a InputStream. This will read the tag id, the data type, the offset of the data and the number of elements of data. Note that the number of elements varies in its meaning depending on the data type.

Parameters: inputStream An InputStream containing a rpm file.

Throws: IOException If an error occurs during reading from stream

Method Detail

getCount

public long getCount()
Get the number of elements of this data type

Returns: The number of elements

getOffset

public long getOffset()
Returns the offset of this data type

Returns: The offset

getSize

public int getSize()
Get the size of this index entry in bytes

Returns: The size

getTag

public long getTag()
Get the tag id as a long

Returns: The tag id

getType

public RPMIndexType getType()
Get the data type of this entry

Returns: The data type