The Jataka, Volume I, tr. by Robert Chalmers, , at sacred-texts.com
 "I found the footprints." This story was told by the Master whilst journeying on an alms-pilgrimage through Kosala, when he had come to the village of Naḷaka-pāna (Cane-drink) and was dwelling at Ketaka-vana near the Pool of Naḷaka-pāna, about cane-sticks. In those days the Brethren, after bathing in the Pool of Naḷaka-pāna, made the novices get them cane-sticks for needle-cases 1, but, finding them hollow throughout, went to the Master and said, "Sir, we had cane-sticks got in order to provide needle-cases; and from top to bottom they are quite hollow. Now how can that be?"
"Brethren," said the Master, "such was my ordinance in times gone by." And, so saying, he told this story of the past.
In past times, we are told, there was a thick forest on this spot. And in the lake here dwelt a water-ogre who used to devour everyone who went down into the water. In those days the Bodhisatta had come to life as the king of the monkeys, and was as big as the fawn of a red deer; he lived in that forest at the head of a troop of no less than eighty thousand monkeys
whom he shielded from harm. Thus did he counsel his subjects:--"My friends, in this forest there are trees that are poisonous and lakes that are haunted by ogres. Mind to ask me first before you either eat any fruit which you have not eaten before, or drink of any water where you have not drunk before." "Certainly," said they readily.
One day they came to a spot they had never visited before. As, they were searching for water to drink after their day's wanderings, they came on this lake. But they did not drink; on the contrary they sat down watching for the coming of the Bodhisatta.
When he came up, he said, "Well, my friends, why don't you drink?"
"We waited for you to come."
Quite right, my friends," said the Bodhisatta. Then he made a circuit of the lake, and scrutinized the footprints round, with the result that he found that all the footsteps led down into the water and none came up again. "Without doubt," thought he to himself, "this is the haunt of an ogre." So he said to his followers, "You are quite right, my friends, in not drinking of this water; for the lake is haunted by an ogre."
When the water-ogre realised that they were not entering his domain,  he assumed the shape of a horrible monster with a blue belly, a white face, and bright-red hands and feet; in this shape he came out from the water, and said, "Why are you seated here? Go down into the lake and drink." But the Bodhisatta said to him, "Are not you the ogre of this water?" "Yes, I am," was the answer. "Do you take as your prey all those who go down into this water?" "Yes, I do; from small birds upwards, I never let anything go which comes down into my water. I will eat the lot of you too." "But we shall not let you eat us." "Just drink the water." "Yes, we will drink the water, and yet not fall into your power." "How do you propose to drink the water, then?" "Ah, you think we shall have to go down into the water to drink; whereas we shall not enter the water at all, but the whole eighty thousand of us will take a cane each and drink therewith from your lake as easily as we could through the hollow stalk of a lotus. And so you will not be able to eat us." And he repeated the latter half of the following stanza (the first half being added by the Master when, as Buddha, he recalled the incident):--
So saying, the Bodhisatta had a cane brought to him. Then, calling to mind the Ten Perfections displayed by him, he recited them in a solemn asseveration 1, and blew down the cane.  Straightway the cane became
hollow throughout, without a single knot being left in all its length. In this fashion he had another and another brought and blew down them. (But if this were so, he could never have finished; and accordingly the foregoing sentence must not be understood in this--literal--sense.) Next the Bodhisatta made the tour of the lake, and commanded, saying, "Let all canes growing here become hollow throughout." Now, thanks to the great virtues of the saving goodness of Bodhisattas, their commands are always fulfilled. And thenceforth every single cane that grew round that lake became hollow throughout.
(In this Kappa, or Era, there are four miracles which endure through the whole Era. What are the four? Well, they are--first, the sign of the hare in the moon 1, which will last through the whole Era; secondly, the spot where the fire was put out as told in the Vaṭṭaka Jātaka 2, which shall remain untouched by fire throughout the Era; thirdly, on the site of Ghaṭīkāra's house 3 no rain shall ever fall while this Era lasts; and lastly, the canes that grow round this lake shall be hollow throughout during the whole of the Era. Such are the four Era-miracles, as they are called.)
After giving this command, the Bodhisatta seated himself with a cane in his hands. All the other eighty thousand monkeys too seated themselves round the lake, each with a cane in his hands. And at the same moment when the Bodhisatta sucked the water up through his cane, they all drank too in the same manner, as they sat on the bank. This was the way they drank, and not one of them could the water-ogre get; so he went off in a rage to his own habitation. The Bodhisatta, too, with his following went back into the forest.
When the Master had ended his lesson and had repeated what he had said as to the hollowness of the canes being the result of a former ordinance of his own, he shewed the connexion, and identified the Birth by saying, "Devadatta was the water-ogre of those days; my disciples were the eighty thousand monkeys; and I was the monkey-king, so fertile in resource."
54:1 In the Vinaya, (Cullav. v. 11), the Buddha is made to allow "the use of a needle-case made of bamboo."
55:1 Literally "made a truth-act." If this is done with intention, a miracle instantly follows. Cf. No. 35 &c.
56:1 See Jātaka No. 316, and Tawney's Kathā-Sarit-Sāgara, Vol. II. p. 66, where a number of passages bearing on this symbol are referred to, and Benfey's Pañca-Tantra, i. 349. See also Cariyā-Piṭaka, p. 82.
56:2 No. 35.
56:3 See the (unpublished) Ghaṭīkāra Sutta (No. 81 of the Majjhima Nikāya), Dhammapada, p. 349, and Milinda-pañha, p. 222.