Implement most of doByteWrite.