a class for write array[] buffer N times to a specified file