Javanese folklore contains the story of a late 4th century Hindu king named Vadhaka who converted to Buddhism. According to the legend, one night, Vadhaka’s mother had a dream about a holy man coming to Java on a flying boat. The very next day, a Kashmiri monk named Gunavarman reached the shores of the island.
On Gunavarman’s arrival, Vadhaka’s mother asked the king to welcome the monk. The conversations that followed between the monk, the king and his mother are recorded in Memoirs of Eminent Monks, a combination of biographies of monks in China that was compiled by Hui Jiao of the Jiaxiang temple in the 5th century.