Class: PAKFile::FileEntryPAK
Overview
File located inside the PAK itself
Instance Attribute Summary
Attributes inherited from FileEntry
Instance Method Summary collapse
-
#initialize(pack, entry) ⇒ FileEntryPAK
constructor
A new instance of FileEntryPAK.
- #read ⇒ Object
Constructor Details
#initialize(pack, entry) ⇒ FileEntryPAK
Returns a new instance of FileEntryPAK.
194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/pakspy.rb', line 194 def initialize(pack, entry) super pack # name - max 58 byte null terminated string # offset - 4 byte integer (little endian) # size - 4 byte integer (little endian) data = entry.unpack "a56VV" @name = data[0].rstrip @offset = data[1] @size = data[2] end |
Instance Method Details
#read ⇒ Object
207 208 209 210 |
# File 'lib/pakspy.rb', line 207 def read @pack.pak_file.seek @offset @pack.pak_file.read @size end |