def METHOD_NAME(self, msg_type, size):
    """Add a message type which all messages are of same length"""
    if msg_type in self.priorities:
        raise ValueError("Message type already defined")
    if size < 1:
        raise ValueError("Message size must be positive integer")
    self.priorities += [msg_type]
    self.buffers[msg_type] = bytearray(0)
    def size_handler(data):
        """
        Size of message in parameter
        If complete message is present in parameter returns its size,
        None otherwise.
        """
        if len(data) < size:
            return None
        else:
            return size
    self.decoders[msg_type] = size_handler