code: def from_stream(cls, reader: ReaderAdapter):
          
          @asyncio.coroutine
          def decode_remaining_length():
              """
              Decode message length according to MQTT specifications
              :return:
              """
              multiplier = 1
              value = 0
              buffer = bytearray()
              while True:
                  encoded_byte = yield from reader.read(1)
                  int_byte = unpack('!B', encoded_byte)
                  buffer.append(int_byte[0])
                  value += (int_byte[0] & 0x7f) * multiplier
                  if (int_byte[0] & 0x80) == 0:
                      break
                  else:
                      multiplier *= 128
                      if multiplier > 128 * 128 * 128:
                          raise MQTTException("Invalid remaining length bytes:%s, packet_type=%d" % (bytes_to_hex_str(buffer), msg_type))
              return value
  
          try:
              byte1 = yield from read_or_raise(reader, 1)
              int1 = unpack('!B', byte1)
              msg_type = (int1[0] & 0xf0) >> 4
              flags = int1[0] & 0x0f
              remain_length = yield from decode_remaining_length()
  
              return cls(msg_type, flags, remain_length)
          except NoDataException:
              return None
docs: Read and decode MQTT message fixed header from stream
          :return: FixedHeader instance