<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def writeBoolean(self, b):
 """ Write boolean to the data stream. @param b: The boolean data to be encoded to the AMF0 data stream. """

        self.writeType(TYPE_BOOL)

        if b:
            self.stream.write_uchar(1)
        else:
            self.stream.write_uchar(0)