public static String extendBy(StringTemplateGroup group, Message extend, Message by) throws IOException
    {
        StringWriter stringer = new StringWriter(16);
        NoIndentWriter out = new NoIndentWriter(stringer);

        StringTemplate messageBlock = group.getInstanceOf("extend_by");
        messageBlock.setAttribute("message", extend);
        messageBlock.setAttribute("by", by);
        messageBlock.write(out);

        return stringer.toString();
    }
Kind of preprocessor for proto files. Able to extend one messages with fields from other ones.

@author Ivan Prisyazhniy, Igor Scherbak
@created Mar 9, 2012
protostuff-compiler/src/main/java/io/protostuff/compiler/ProtoToProtoCompiler.java