out.writeEnum(wrappedEnum, enumEncoder.encode((Enum) t));
} else {
// this is either an unknown primitive type or a message type
// try to use a message marshaller
MessageMarshaller marshaller = ctx.getMarshaller(t.getClass());
out.writeString(wrappedDescriptorFullName, marshaller.getFullName());
out.writeTag(wrappedMessageBytes, WireFormat.WIRETYPE_LENGTH_DELIMITED);
ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); //todo here we should use a better buffer allocation strategy
CodedOutputStream out2 = CodedOutputStream.newInstance(baos2);
ProtobufWriterImpl writer = new ProtobufWriterImpl(ctx);