Abstracting most of the functionality of DataOutputFile
into a parent class so that the implementation can be used
by other classes.