Data dissemination in delay tolerant networks (DTNs) has been extensively studied in recent years. The end-to-end path between any two nodes in DTNs suffers intermittence frequently, so the nodes exploit the store-carry-forward routing paradigm to communicate with others. When two nodes come into contact with each other, how to select data objects for buffering is a critical problem for each node, which affects the data dissemination performance of the system. Nodes in DTNs usually lack the global network information, so they cannot make the global optimal selection of data objects for buffering. In order to solve this problem, the global optimization problem is converted to an optimization problem under each contact, and the new problem can be formulated as 0-1 knapsack problem in this paper. A heuristic algorithm is proposed to solve this 0-1 knapsack problem and instructs nodes to selectively buffer data objects for maximizing the gain in system utility even when nodes maintain local network information. Furthermore, this paper investigates the relationship between the decisions made by the nodes and the scope of network information they maintain. Extensive trace-driven simulations based on MIT trace are conducted to evaluate the performance of our heuristic algorithm. The results demonstrate that our heuristic algorithm can achieve better performance than SocialCast algorithm. And the simulation results also show that the larger scope of network information the nodes maintain, the better performance our heuristic algorithm can achieve.