Class Resource

  • Direct Known Subclasses:
    ResourceStringTable

    public class Resource
    extends java.lang.Object
    An implementation of the new-executable TNAMEINFO structure.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static short FLAG_MOVEABLE
      The resources is not fixed.
      static short FLAG_PRELOAD
      The resource is preloaded.
      static short FLAG_PURE
      The resource can be shared.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getBytes()
      Returns the actual bytes for this resource.
      short getFileLength()
      Returns the file length of this resource.
      int getFileLengthShifted()
      Returns the shifted file length of this resource.
      short getFileOffset()
      Returns the file offset of this resource.
      int getFileOffsetShifted()
      Returns the shifted file offset of this resource.
      short getFlagword()
      Returns the flag word of this resource.
      short getHandle()
      Returns the handle of this resource.
      short getResourceID()
      Returns the resource ID of this resource.
      short getUsage()
      Returns the usage of this resource.
      boolean isMoveable()
      Returns true if this resource is moveable.
      boolean isPreload()
      Returns true if this resource is preloaded.
      boolean isPure()
      Returns true if this resource is pure.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • FLAG_MOVEABLE

        public static final short FLAG_MOVEABLE
        The resources is not fixed.
        See Also:
        Constant Field Values
      • FLAG_PURE

        public static final short FLAG_PURE
        The resource can be shared.
        See Also:
        Constant Field Values
      • FLAG_PRELOAD

        public static final short FLAG_PRELOAD
        The resource is preloaded.
        See Also:
        Constant Field Values
    • Method Detail

      • getFileOffset

        public short getFileOffset()
        Returns the file offset of this resource.
        Returns:
        the file offset of this resource
      • getFileLength

        public short getFileLength()
        Returns the file length of this resource.
        Returns:
        the file length of this resource
      • getFlagword

        public short getFlagword()
        Returns the flag word of this resource.
        Returns:
        the flag word of this resource
      • getResourceID

        public short getResourceID()
        Returns the resource ID of this resource.
        Returns:
        the resource ID of this resource
      • getHandle

        public short getHandle()
        Returns the handle of this resource.
        Returns:
        the handle of this resource
      • getUsage

        public short getUsage()
        Returns the usage of this resource.
        Returns:
        the usage of this resource
      • isMoveable

        public boolean isMoveable()
        Returns true if this resource is moveable.
        Returns:
        true if this resource is moveable
      • isPure

        public boolean isPure()
        Returns true if this resource is pure.
        Returns:
        true if this resource is pure
      • isPreload

        public boolean isPreload()
        Returns true if this resource is preloaded.
        Returns:
        true if this resource is preloaded
      • getFileOffsetShifted

        public int getFileOffsetShifted()
        Returns the shifted file offset of this resource. this.getFileOffset() << ResourceTable.getAlignmentShiftCount()
        Returns:
        the shifted file offset of this resource
      • getFileLengthShifted

        public int getFileLengthShifted()
        Returns the shifted file length of this resource. this.getFileLength() << ResourceTable.getAlignmentShiftCount()
        Returns:
        the shifted file length of this resource
      • getBytes

        public byte[] getBytes()
                        throws java.io.IOException
        Returns the actual bytes for this resource.
        Returns:
        the actual bytes for this resource
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()