Files

Class Index [+]

Quicksearch

Thrift::MemoryBufferTransport

Constants

GARBAGE_BUFFER_SIZE

Public Class Methods

new(buffer = nil) click to toggle source

If you pass a string to this, you should # that string unless you want it to be modified by # and #

    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/memory_buffer_transport.rb, line 30
30:     def initialize(buffer = nil)
31:       @buf = buffer || ''
32:       @index = 0
33:     end

Public Instance Methods

available() click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/memory_buffer_transport.rb, line 55
55:     def available
56:       @buf.length - @index
57:     end
close() click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/memory_buffer_transport.rb, line 42
42:     def close
43:     end
flush() click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/memory_buffer_transport.rb, line 77
77:     def flush
78:     end
inspect_buffer() click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/memory_buffer_transport.rb, line 80
80:     def inspect_buffer
81:       out = []
82:       for idx in 0...(@buf.size)
83:         # if idx != 0
84:         #   out << " "
85:         # end
86:       
87:         if idx == @index
88:           out << ">"
89:         end
90:       
91:         out << @buf[idx].ord.to_s(16)
92:       end
93:       out.join(" ")
94:     end
open() click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/memory_buffer_transport.rb, line 39
39:     def open
40:     end
open?() click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/memory_buffer_transport.rb, line 35
35:     def open?
36:       return true
37:     end
peek() click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/memory_buffer_transport.rb, line 45
45:     def peek
46:       @index < @buf.size
47:     end
read(len) click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/memory_buffer_transport.rb, line 59
59:     def read(len)
60:       data = @buf.slice(@index, len)
61:       @index += len
62:       @index = @buf.size if @index > @buf.size
63:       if @index >= GARBAGE_BUFFER_SIZE
64:         @buf = @buf.slice(@index..1)
65:         @index = 0
66:       end
67:       if data.size < len
68:         raise EOFError, "Not enough bytes remain in buffer"
69:       end
70:       data
71:     end
reset_buffer(new_buf = '') click to toggle source

this method does not use the passed object directly but copies it

    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/memory_buffer_transport.rb, line 50
50:     def reset_buffer(new_buf = '')
51:       @buf.replace new_buf
52:       @index = 0
53:     end
write(wbuf) click to toggle source
    # File /tmp/buildd/evernote-mode-0.10/ruby/lib/thrift/transport/memory_buffer_transport.rb, line 73
73:     def write(wbuf)
74:       @buf << wbuf
75:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.