Adjust putBytes for truncated byte buffers.