Method: Net::SSH::Buffer#write_string

Defined in:
lib/net/ssh/buffer.rb

#write_string(*text) ⇒ Object

Writes each argument to the buffer as an SSH2-encoded string. Each string is prefixed by its length, encoded as a 4-byte long integer. Does not alter the read position. Returns the buffer object.



403
404
405
406
407
408
409
410
# File 'lib/net/ssh/buffer.rb', line 403

def write_string(*text)
  text.each do |string|
    s = string.to_s
    write_long(s.bytesize)
    write(s)
  end
  self
end