Class Thrift::BaseTransport
In: lib/thrift/transport/base_transport.rb
lib/thrift/transport/base_transport.rb
Parent: Object

Methods

<<   <<   close   close   flush   flush   open   open   open?   open?   read   read   read_all   read_all   read_byte   read_byte   read_into_buffer   read_into_buffer   write   write  

Public Instance methods

<<(buf)

Alias for write

<<(buf)

Alias for write

[Source]

    # File lib/thrift/transport/base_transport.rb, line 62
62:     def close; end

[Source]

    # File lib/thrift/transport/base_transport.rb, line 62
62:     def close; end

[Source]

    # File lib/thrift/transport/base_transport.rb, line 99
99:     def flush; end

[Source]

    # File lib/thrift/transport/base_transport.rb, line 99
99:     def flush; end

[Source]

    # File lib/thrift/transport/base_transport.rb, line 60
60:     def open; end

[Source]

    # File lib/thrift/transport/base_transport.rb, line 60
60:     def open; end

[Source]

    # File lib/thrift/transport/base_transport.rb, line 58
58:     def open?; end

[Source]

    # File lib/thrift/transport/base_transport.rb, line 58
58:     def open?; end

[Source]

    # File lib/thrift/transport/base_transport.rb, line 64
64:     def read(sz)
65:       raise NotImplementedError
66:     end

[Source]

    # File lib/thrift/transport/base_transport.rb, line 64
64:     def read(sz)
65:       raise NotImplementedError
66:     end

[Source]

    # File lib/thrift/transport/base_transport.rb, line 85
85:     def read_all(size)
86:       return '' if size <= 0
87:       buf = read(size)
88:       while (buf.length < size)
89:         chunk = read(size - buf.length)
90:         buf << chunk
91:       end
92:     
93:       buf
94:     end

[Source]

    # File lib/thrift/transport/base_transport.rb, line 85
85:     def read_all(size)
86:       return '' if size <= 0
87:       buf = read(size)
88:       while (buf.length < size)
89:         chunk = read(size - buf.length)
90:         buf << chunk
91:       end
92:     
93:       buf
94:     end

Returns an unsigned byte as a Fixnum in the range (0..255).

[Source]

    # File lib/thrift/transport/base_transport.rb, line 69
69:     def read_byte
70:       buf = read_all(1)
71:       return ::Thrift::TransportUtils.get_string_byte(buf, 0)
72:     end

Returns an unsigned byte as a Fixnum in the range (0..255).

[Source]

    # File lib/thrift/transport/base_transport.rb, line 69
69:     def read_byte
70:       buf = read_all(1)
71:       return ::Thrift::TransportUtils.get_string_byte(buf, 0)
72:     end

Reads size bytes and copies them into buffer.

[Source]

    # File lib/thrift/transport/base_transport.rb, line 75
75:     def read_into_buffer(buffer, size)
76:       tmp = read_all(size)
77:       i = 0
78:       tmp.each_byte do |byte|
79:         ::Thrift::TransportUtils.set_string_byte(buffer, i, byte)
80:         i += 1
81:       end
82:       i
83:     end

Reads size bytes and copies them into buffer.

[Source]

    # File lib/thrift/transport/base_transport.rb, line 75
75:     def read_into_buffer(buffer, size)
76:       tmp = read_all(size)
77:       i = 0
78:       tmp.each_byte do |byte|
79:         ::Thrift::TransportUtils.set_string_byte(buffer, i, byte)
80:         i += 1
81:       end
82:       i
83:     end

[Source]

    # File lib/thrift/transport/base_transport.rb, line 96
96:     def write(buf); end

[Source]

    # File lib/thrift/transport/base_transport.rb, line 96
96:     def write(buf); end

[Validate]