JniEnvironment.InstanceMethods.GetMethodID 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| GetMethodID(JniObjectReference, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) |
使用 UTF-8 名称和签名范围查找 JNI 实例方法 ID。
与文本一起使用 |
| GetMethodID(JniObjectReference, String, String) |
解析 JNI 实例方法或构造函数标识符。 |
GetMethodID(JniObjectReference, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)
使用 UTF-8 名称和签名范围查找 JNI 实例方法 ID。
与文本一起使用 "methodName"u8 以避免字符串封送开销。
public static Java.Interop.JniMethodInfo GetMethodID(Java.Interop.JniObjectReference type, ReadOnlySpan<byte> name, ReadOnlySpan<byte> signature);
static member GetMethodID : Java.Interop.JniObjectReference * ReadOnlySpan<byte> * ReadOnlySpan<byte> -> Java.Interop.JniMethodInfo
参数
- type
- JniObjectReference
对用于方法查找的 Java 类的有效引用。
- name
- ReadOnlySpan<Byte>
Java方法名称或<init>构造函数,编码为已修改的 UTF-8。
- signature
- ReadOnlySpan<Byte>
编码为修改后的 UTF-8 的 JNI 方法描述符。
返回
实例方法或构造函数的有效 JNI 信息。
注解
两个字节序列必须在内存中终止。 每个零终止符都可以位于范围内,也可以紧随其后,就像字符串文本一 u8 样。 其字节将传递到 JNI,而不进行转码或长度参数。 查找中的挂起Java异常将转换为托管异常。
适用于
GetMethodID(JniObjectReference, String, String)
解析 JNI 实例方法或构造函数标识符。
public static Java.Interop.JniMethodInfo GetMethodID(Java.Interop.JniObjectReference type, string name, string signature);
static member GetMethodID : Java.Interop.JniObjectReference * string * string -> Java.Interop.JniMethodInfo
参数
- type
- JniObjectReference
对用于方法查找的 Java 类的有效引用。
- name
- String
Java方法名称或<init>构造函数。
- signature
- String
JNI 方法描述符。
返回
实例方法或构造函数的有效 JNI 信息。
注解
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。