Move read/write to docengine for consistency.