It sounds like you're working in Java.
In Java you need to create, setup, and then provide an
ExtensionRegistry
1) The way you do this is you create a new one...
final ExtensionRegistry extensionRegistry =
ExtensionRegistry.newInstance();
2) then register any extensions you have by calling the appropriate
compiled proto FILE classes'
"registerAllExtensions(ExtensionRegistry)" method as such...
MyProtoFile.registerAllExtensions(extensionRegistry);
Tip: the name of this class is determined by the name of your proto
file or the "java_outer_classname" file option.
3) Then you can parse messages with this ExtensionRegistry via...
MyMessage.parse(bytes, extensionRegistry);
You probably want to create the extension registry once and then save
it for use during all parsing. You will likely need to register
multiple files worth of extension (depends on how you use extensions)
in which case simply repeat step 2 for each file using the same
ExtensionRegistry instance - all the extensions must be registered to
the same registry.