module FFI::IO

def self.native_read(io, buf, len)

Returns:
  • (Numeric) - length really read, in bytes

Parameters:
  • len (nil, Numeric) -- maximul number of bytes to read from +io+. If +nil+,
  • buf (AbstractMemory) -- destination for data read from +io+
  • io (#read) -- io to read from
def self.native_read(io, buf, len)
  tmp = io.read(len)
  return -1 unless tmp
  buf.put_bytes(0, tmp)
  tmp.length
end