class Thrift::BaseTransport

Public Instance Methods

<<(buf)
Alias for: write
close() click to toggle source
   # File lib/thrift/transport/base_transport.rb
62 def close; end
flush() click to toggle source
   # File lib/thrift/transport/base_transport.rb
99 def flush; end
open() click to toggle source
   # File lib/thrift/transport/base_transport.rb
60 def open; end
open?() click to toggle source
   # File lib/thrift/transport/base_transport.rb
58 def open?; end
read(sz) click to toggle source
   # File lib/thrift/transport/base_transport.rb
64 def read(sz)
65   raise NotImplementedError
66 end
read_all(size) click to toggle source
   # File lib/thrift/transport/base_transport.rb
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
read_byte() click to toggle source

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

   # File lib/thrift/transport/base_transport.rb
69 def read_byte
70   buf = read_all(1)
71   return ::Thrift::TransportUtils.get_string_byte(buf, 0)
72 end
read_into_buffer(buffer, size) click to toggle source

Reads size bytes and copies them into buffer.

   # File lib/thrift/transport/base_transport.rb
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
write(buf) click to toggle source
   # File lib/thrift/transport/base_transport.rb
96 def write(buf); end
Also aliased as: <<