I think the problem you have here is one of design. Serializing to a file shouldn't be modifying that data in anyway, so why should those functions be private? If all you are doing is examining data and writing it out, you should have an adequate public interface.