private ProtoFile loadDescriptorProto ( ) throws IOException { InputStream resourceAsStream = SchemaLoader . class . getResourceAsStream ( "/" + DESCRIPTOR_PROTO ) ; try ( BufferedSource buffer = Okio . buffer ( Okio . source ( resourceAsStream ) ) ) { String data = buffer . readUtf8 ( ) ; Location location = Location . get ( "" , DESCRIPTOR_PROTO ) ; ProtoFileElement element = ProtoParser . parse ( location , data ) ; return ProtoFile . get ( element ) ; } }
Returns Google s protobuf descriptor which defines standard options like default deprecated and java_package . If the user has provided their own version of the descriptor proto that is preferred .