Rewrote a few read/write functions.

Rewrote a few read/write functions in the DataBuffer class.