Method: Thrift::MemoryBufferTransport#initialize

Defined in:
lib/thrift/transport/memory_buffer_transport.rb

#initialize(buffer = nil) ⇒ MemoryBufferTransport

If you pass a string to this, you should #dup that string unless you want it to be modified by #read and #write – this behavior is no longer required. If you wish to change it go ahead, just make sure the specs pass



30
31
32
33
# File 'lib/thrift/transport/memory_buffer_transport.rb', line 30

def initialize(buffer = nil)
  @buf = buffer ? Bytes.force_binary_encoding(buffer) : Bytes.empty_byte_buffer
  @index = 0
end