Replace the bytes in buf from the offset by data.
buffer where data will be written
offset of the bytes in buf to replace
bytes to write
Replace the bytes in buf from the offset by data.