module Redis::Connection::SocketMixin

def read(nbytes)

def read(nbytes)
  result = @buffer.slice!(0, nbytes)
  buffer = String.new(capacity: nbytes, encoding: Encoding::ASCII_8BIT)
  result << _read_from_socket(nbytes - result.bytesize, buffer) while result.bytesize < nbytes
  result
end