1 Star 0 Fork 0

taiji1986/BridJ

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Run.java 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
import java.io.IOException;
import org.bridj.BridJ;
import org.bridj.DynamicCallback;
import org.bridj.DynamicFunction;
import org.bridj.Pointer;
import org.bridj.objc.FoundationLibrary;
import org.bridj.objc.NSString;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author ochafik
*/
public class Run {
public static void main(String[] args) throws IOException {
//Pointer<NSString> ps = FoundationLibrary.pointerToNSString("Hehe");
//NSString s = ps.get();
BridJ.getNativeLibrary("src/test/resources/org/bridj/lib/darwin_universal/libtest.dylib").release();
/*
Pointer dc = Pointer.allocateDynamicCallback(
new DynamicCallback<Integer>() {
public Integer apply(Object... args) {
int a = (Integer)args[0];
int b = (Integer)args[1];
return a + b;
}
}, null, int.class, int.class, int.class
);
DynamicFunction<Integer> df = dc.asUntyped().asDynamicFunction(null, int.class, int.class, int.class);
int ret = df.apply(1, 2);
*/
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/yangtf/BridJ.git
[email protected]:yangtf/BridJ.git
yangtf
BridJ
BridJ
master

搜索帮助