code: def write(self, data):
          
          if isinstance(data, bytearray):
              data = bytes(data)
  
          if not isinstance(data, byte_types):
              raise ValueError("A bytes argument is required")
  
          res = librtmp.RTMP_Write(self.client.rtmp, data, len(data))
  
          if res < 0:
              raise IOError("Failed to write data")
  
          return res
docs: Writes data to the stream.
  
          :param data: bytes, FLV data to write to the stream
  
          The data passed can contain multiple FLV tags, but it MUST
          always contain complete tags or undefined behaviour might
          occur.
  
          Raises :exc:`IOError` on error.