Sha256: e311053ddc2c6b4c38cd60b57fbef617751381e7c6ac4ef9ab4415f53e3f643e

Contents?: true

Size: 408 Bytes

Versions: 17

Compression:

Stored size: 408 Bytes

Contents

module FFI
  module IO
    def self.for_fd(fd, mode = "r")
      ::IO.for_fd(fd, mode)
    end

    #
    # A version of IO#read that reads into a native buffer
    # 
    # This will be optimized at some future time to eliminate the double copy
    #
    def self.native_read(io, buf, len)
      tmp = io.read(len)
      return -1 unless tmp
      buf.put_bytes(0, tmp)
      tmp.length
    end

  end
end

Version data entries

17 entries across 17 versions & 4 rubygems

Version Path
ffi-ffi-0.5.0 lib/ffi/io.rb
remogatto-ffi-0.5.0 lib/ffi/io.rb
ffi-0.5.4-x86-mswin32 lib/ffi/io.rb
ffi-0.5.4-x86-mingw32 lib/ffi/io.rb
ffi-0.5.4 lib/ffi/io.rb
ffi-0.5.3-x86-mswin32 lib/ffi/io.rb
ffi-0.5.3 lib/ffi/io.rb
ffi-0.5.3-x86-mingw32 lib/ffi/io.rb
minilab-1.1.0-x86-mswin32-60 vendor/ffi-0.4.0-x86-mswin32/lib/ffi/io.rb
ffi-0.5.1-x86-mswin32 lib/ffi/io.rb
ffi-0.5.1 lib/ffi/io.rb
ffi-0.5.1-x86-mingw32 lib/ffi/io.rb
ffi-0.5.0-x86-mswin32 lib/ffi/io.rb
ffi-0.5.0-x86-mingw32 lib/ffi/io.rb
ffi-0.5.0 lib/ffi/io.rb
ffi-0.4.0-x86-mswin32 lib/ffi/io.rb
ffi-0.4.0 lib/ffi/io.rb