class_docstr: Represents a resource stored within a resource fork.
  
  Attributes:
          type: resource type.
          data: resource data.
          id: ID.
          name: resource name.
          attr: attributes.
class_docstr_tok: ["Represents","a","resource","stored","within","a","resource","fork",".","Attributes",":","type",":","resource","type",".","data",":","resource","data",".","id",":","ID",".","name",":","resource","name",".","attr",":","attributes","."]
code: def decompile(self, refData, reader):
      sstruct.unpack(ResourceRefItem, refData, self)
      # interpret 3-byte dataOffset as (padded) ULONG to unpack it with struct
      (self.dataOffset,) = struct.unpack(
          ">L", bytesjoin([b"\0", self.dataOffset])
      )
      absDataOffset = reader.dataOffset + self.dataOffset
      (dataLength,) = struct.unpack(
          ">L", reader._read(4, absDataOffset)
      )
      self.data = reader._read(dataLength)
      if self.nameOffset == -1:
          return
      absNameOffset = reader.absNameListOffset + self.nameOffset
      (nameLength,) = struct.unpack("B", reader._read(1, absNameOffset))
      (name,) = struct.unpack(
          ">%ss" % nameLength, reader._read(nameLength)
      )
      self.name = tostr(name, encoding="mac-roman")
  
imports: from io import BytesIO
  import struct
  from fontTools.misc import sstruct
  from fontTools.misc.textTools import bytesjoin, tostr
  from collections import OrderedDict
  from collections.abc import MutableMapping
label_desc: Use image node_id 2 for calling the Resource obj's underlying member method code with example usage: obj.decompile(refData, reader) without return types