Method: CTypes::Type#pread
- Defined in:
- lib/ctypes/type.rb
#pread(io, pos, endian: default_endian) ⇒ Object
read a fixed-sized type from an IO instance at a specific offset and unpack it
107 108 109 110 111 112 113 114 |
# File 'lib/ctypes/type.rb', line 107 def pread(io, pos, endian: default_endian) unless fixed_size? raise NotImplementedError, "pread() does not support variable-length types" end unpack(io.pread(@size, pos), endian: default_endian) end |