Implements the write operation. Handles, automatically, the looping necessary to write a large data set.