Add methods read and write for files