class Gio::RubyInputStream

Public Class Methods

new(ruby_input) click to toggle source
Calls superclass method
# File lib/gio2/ruby-input-stream.rb, line 28
def initialize(ruby_input)
  @ruby_input = ruby_input
  @buffer = +""
  super()
end

Private Instance Methods

ruby_io() click to toggle source
# File lib/gio2/ruby-input-stream.rb, line 35
def ruby_io
  @ruby_input
end
virtual_do_close_fn(cancellable) click to toggle source
# File lib/gio2/ruby-input-stream.rb, line 65
def virtual_do_close_fn(cancellable)
  @ruby_input.close
  true
end
virtual_do_read_fn(buffer_address, count, cancellable) click to toggle source
# File lib/gio2/ruby-input-stream.rb, line 39
def virtual_do_read_fn(buffer_address, count, cancellable)
  buffer = Fiddle::Pointer.new(buffer_address)
  if @ruby_input.read(count, @buffer)
    buffer[0, @buffer.bytesize] = @buffer
    @buffer.bytesize
  else
    0
  end
end
virtual_do_skip(count, cancellable) click to toggle source
# File lib/gio2/ruby-input-stream.rb, line 49
def virtual_do_skip(count, cancellable)
  if @ruby_input.respond_to?(:seek)
    if @ruby_input.seek(count, IO::SEEK_CUR).zero?
      count
    else
      -1
    end
  else
    if @ruby_input.read(count, @buffer)
      @buffer.bytesize
    else
      -1
    end
  end
end