Files

Class Index [+]

Quicksearch

Thrift::BufferedTransport

Constants

DEFAULT_BUFFER

Public Class Methods

new(transport) click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/buffered_transport.rb, line 25
25:     def initialize(transport)
26:       @transport = transport
27:       @wbuf = ''
28:       @rbuf = ''
29:       @index = 0
30:     end

Public Instance Methods

close() click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/buffered_transport.rb, line 40
40:     def close
41:       flush
42:       @transport.close
43:     end
flush() click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/buffered_transport.rb, line 62
62:     def flush
63:       if @wbuf != ''
64:         @transport.write(@wbuf)
65:         @wbuf = ''
66:       end
67:       
68:       @transport.flush
69:     end
open() click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/buffered_transport.rb, line 36
36:     def open
37:       @transport.open
38:     end
open?() click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/buffered_transport.rb, line 32
32:     def open?
33:       return @transport.open?
34:     end
read(sz) click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/buffered_transport.rb, line 45
45:     def read(sz)
46:       @index += sz
47:       ret = @rbuf.slice(@index - sz, sz) || ''
48: 
49:       if ret.length == 0
50:         @rbuf = @transport.read([sz, DEFAULT_BUFFER].max)
51:         @index = sz
52:         ret = @rbuf.slice(0, sz) || ''
53:       end
54: 
55:       ret
56:     end
write(buf) click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/buffered_transport.rb, line 58
58:     def write(buf)
59:       @wbuf << buf
60:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.