Added methods for writing doubles to buffer