-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathJavaUtils.bal
31 lines (26 loc) · 908 Bytes
/
JavaUtils.bal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import ballerina/jballerina.java;
function loadJavaCpp(handle c) returns handle = @java:Method {
name: "load",
'class: "org.bytedeco.javacpp.Loader",
paramTypes: ["java.lang.Class"]
} external;
function jGetClass(handle receiver) returns handle = @java:Method {
name: "getClass",
'class: "java.lang.Object",
paramTypes: []
} external;
function jGetClassLoader(handle receiver) returns handle = @java:Method {
name: "getClassLoader",
'class: "java.lang.Class",
paramTypes: []
} external;
function jGetResourceAsStream(handle receiver, handle res) returns handle = @java:Method {
name: "getResourceAsStream",
'class: "java.lang.ClassLoader",
paramTypes: ["java.lang.String"]
} external;
function jRead(handle receiver, handle buffer) returns int|error = @java:Method {
name: "read",
'class: "java.io.InputStream",
paramTypes: ["[B"]
} external;