Implement encode() method for serializing MetaInfo