Hopefully the compiler sorts this out, but why not hoist the size-1 compare out of the loop:
for (unsigned i = 0; i < (size - 1); i++) {
  write(buffer[i]); checksum += buffer[i];
}
write(checksum);

This would make it more obvious to the casual reader that the checksum is sent last.