Method: Net::SSH::Buffer#read

Defined in:
lib/tpkg/thirdparty/net-ssh-2.1.0/lib/net/ssh/buffer.rb

#read(count = nil) ⇒ Object

Reads and returns the next count bytes from the buffer, starting from the read position. If count is nil, this will return all remaining text in the buffer. This method will increment the pointer.



171
172
173
174
175
176
# File 'lib/tpkg/thirdparty/net-ssh-2.1.0/lib/net/ssh/buffer.rb', line 171

def read(count=nil)
  count ||= length
  count = length - @position if @position + count > length
  @position += count
  @content[@position-count, count]
end