Byonggon Chun
Byonggon Chun

Reputation: 45

Does anyone know JNI signature type of Enumeration Interface?

I`m trying jni call with static method which returing Enumeration in android api.

But, I can`t figure out signature of return type of below method. "Enumeration getNetworkInterfaces ()"

Does anyone know?

Upvotes: 0

Views: 313

Answers (1)

Tom Blodget
Tom Blodget

Reputation: 20812

javap -s java.net.NetworkInterface | grep -A 2 "getNetworkInterfaces"

gives

public static java.util.Enumeration<java.net.NetworkInterface> getNetworkInterfaces() throws java.net.SocketException;
Signature: ()Ljava/util/Enumeration;

so, the return type is "Ljava/util/Enumeration;"

(In general, when using javap, add the classpath argument if necessary.)

Java implements generics with "type erasure" so in JNI you won't see them.

Upvotes: 2

Related Questions