Added streamableToFile function.