Class ResourceParser.ResourceEntry

  • Enclosing class:
    ResourceParser

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte getAttributes()
      Get the attributes for this resource.
      int getDataOffset()
      Get the offset to the resource data for this resource.
      int getID()
      Get the id of this resource.
      java.lang.String getName()
      Get the name of this resource.
      byte[] getNameBytes()
      Get the bytes of the resource name.
      int getNameOffset()
      Get the offset to the name data for this resource.
      int getScriptCode()
      Get the script code used to turn the name bytes for this resource into a name string.
      byte[] getType()
      Get the type of this resource.
      java.lang.String toString()
      Put this ResourceEntry into a string format for debugging or logging purposes.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 java.lang.String toString()
        Put this ResourceEntry into a string format for debugging or logging purposes.
        Overrides:
        toString in class java.lang.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 java.lang.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