def dump(*args)
      return need_permission unless dumpable?

      base, len = base_len_of(*args)
      file = mem_f
      file.pos = base
      mem = file.readpartial(len)
      file.close
      mem
    rescue => e # rubocop:disable Style/RescueStandardError
      raise e if e.is_a? ArgumentError

      nil
    end
def dump(*args)
      return need_permission unless dumpable?

      base, len = base_len_of(*args)
      file = mem_f
      file.pos = base
      mem = file.readpartial(len)
      file.close
      mem
    rescue => e # rubocop:disable Style/RescueStandardError
      raise e if e.is_a? ArgumentError

      nil
    end
Instantiate a {HeapInfo::Dumper} object

 @param [String] mem_filename The filename that can be access for dump. Should be +/proc/[pid]/mem+.
 @param [Proc] block
   Use for get segment info.
   See {Dumper#base_len_of} for more information.
 A helper for {HeapInfo::Process} to dump memory.
 @param [Mixed] args The use input commands, see examples of {HeapInfo::Process#dump}.
 @return [String, nil] Dump results. If error happend, +nil+ is returned.
 @example
   p dump(:elf, 4)
   #=> "\x7fELF"