<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def WriteTo(self, values):
 """Writes values to a byte stream. Args: Returns: bytes: byte stream. Raises: IOError: if byte stream cannot be written. OSError: if byte stream cannot be read. """

    try:
      return self._struct.pack(*values)
    except (TypeError, struct.error) as exception:
      raise IOError('Unable to write stream with error: {0!s}'.format(
          exception))