Is there a way to get the field descriptor by using the given field number in protocol buffers? I know it exists for C++ (FindKnownExtensionsByNumber()) using reflection, however, I couldn't one for Java.
I suspect you're looking for Descriptor.findFieldByNumber
. Note that will find a field by number, not an extension. For extensions, use ExtensionRegistry.findExtensionByNumber
.
See more on this question at Stackoverflow