<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_string(self, string):
 """Write a string to this packet."""

        self.write_uint16(len(string))
        self.write_bytes(string, len(string))