finish FileIO and its tests implementation.