[英]Can C# do something like SPI in Java (Meta-inf/service)?
I am currently working on converting .JPEG
file to .WSQ
file, I have successfully done it in Java using a library from http://sourceforge.net/projects/jmrtd/ . 我目前正在将.JPEG
文件转换为.WSQ
文件,我已经使用http://sourceforge.net/projects/jmrtd/中的库在Java中成功完成了该工作。
Now I wanted to do the same thing in C#, I converted the .jar
files into .dll
files using IKVM and I can call the libraries of Java in my C# application. 现在,我想在C#中做同样的事情,我使用IKVM将.jar
文件转换为.dll
文件,并且可以在C#应用程序中调用Java库。 But there is a problem, in Java, I found out that the function to convert JPEG to WSQ is available in the external library which is added as an external SPI from the META-INF/service folder. 但是有一个问题,在Java中,我发现外部库中提供了将JPEG转换为WSQ的功能,该库是从META-INF / service文件夹作为外部SPI添加的。 Something like http://docs.oracle.com/javase/tutorial/sound/SPI-intro.html . 类似于http://docs.oracle.com/javase/tutorial/sound/SPI-intro.html 。
The external library is called "indirectly" in Java from what I understand, how can I do this in C#? 据我所知,外部库在Java中被称为“间接”,如何在C#中做到这一点? Is this even possible? 这有可能吗?
If the "external library" a second jar file then compile both jar files in one step with the parenthesis syntax. 如果是“外部库”,则使用第二个jar文件,然后使用括号语法在一个步骤中编译两个jar文件。 Then it should work. 然后它应该工作。
For details see the IKVM wiki: 有关详细信息,请参见IKVM Wiki:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.