Class ResourceParser.ResourceEntry

  • Enclosing class:
    ResourceParser

    public static class ResourceParser.ResourceEntry
    extends Object
    Information about a specific resource. This information is used internally for parsing and is also given to the callback resource type handlers.
    • Method Detail

      • getDataOffset

        public int getDataOffset()
        Get the offset to the resource data for this resource.
        Returns:
        the offset of the data for this resource from the beginning of the resource table
      • getNameOffset

        public int getNameOffset()
        Get the offset to the name data for this resource.
        Returns:
        the offset to the name of this resource from the beginning of the name table; -1 if no name entry
      • toString

        public String toString()
        Put this ResourceEntry into a string format for debugging or logging purposes.
        Overrides:
        toString in class Object
        Returns:
        the string representation
      • getType

        public byte[] getType()
        Get the type of this resource. The type is a 4 byte identifier unique to a specific resource type.
        Returns:
        the type of this resource
      • getAttributes

        public byte getAttributes()
        Get the attributes for this resource.
        Returns:
        the bit flags containing the attributes
      • getNameBytes

        public byte[] getNameBytes()
        Get the bytes of the resource name. These are the raw bytes exactly as encoded in the name table.
        Returns:
        the raw bytes of the resource name
      • getName

        public String getName()
        Get the name of this resource. This name is interpreted from the name bytes by using heuristics to guess the encoding. If no guess was possible or it was not possible to decode those bytes this will return null.
        Returns:
        the resource name
      • getScriptCode

        public int getScriptCode()
        Get the script code used to turn the name bytes for this resource into a name string.
        Returns:
        the script code used for the name of this resource
      • getID

        public int getID()
        Get the id of this resource.
        Returns:
        the id of this resource