class FFI::Pointer

def read_string(len=nil)

Returns:
  • (String) -

Parameters:
  • len (nil, Integer) -- length of string to return
def read_string(len=nil)
  if len
    return ''.b if len == 0
    get_bytes(0, len)
  else
    get_string(0)
  end
end unless method_defined?(:read_string)