Most exiting delay-tolerant network (DTN) routing algorithms consider only the impact of node mobility such as contact frequency and contact duration on data delivery without considering the effects of available resources in terms of storage, energy and processing power. In realistic DTNs, these resources may be constrained. In this paper, we propose a Buffer Aware Routing (BAR) mechanism for resource constrained DTNs, which exploits both node contact probabilities and remaining buffer resources to determine whether a packet is delivered when two nodes encounter. In BAR, node can adaptively adjust the transmission policy according to the amount of remaining buffer, which can reduce the data overflow of buffer and improve resource utilization. We use the Opportunistic Network Environment (ONE) Simulator to evaluate the performance of BAR. Simulation results show BAR significantly outperforms several exiting known DTN routing algorithms, in terms of data delivery ratio, data delay, and resource consumption, etc.