class Net::SSH::Buffer
def consume!(n = position)
would otherwise tend to grow without bound.
to be appended. It helps to keep the size of buffers down when they
buffer that has previously been read, when you are expecting more data
unless otherwise specified. This is useful for removing data from the
Consumes n bytes from the buffer, where n is the current position
def consume!(n = position) if n >= length # optimize for a fairly common case clear! elsif n > 0 @content = @content[n..-1] || String.new @position -= n @position = 0 if @position < 0 end self end