Clean up of the write() function for the new get_data() design.
Authored by: bugman 2010-02-19
Parent: [r10780]
Child: [r10782]