Parcel 类

定义

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

[Android.Runtime.Register("android/os/Parcel", DoNotGenerateAcw=true)]
public sealed class Parcel : Java.Lang.Object
[<Android.Runtime.Register("android/os/Parcel", DoNotGenerateAcw=true)>]
type Parcel = class
    inherit Object
继承
Parcel
属性

注解

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。 包裹可以包含使用此处用于编写特定类型的各种方法在 IPC (的另一端展开的平展数据,也可以 Parcelable 包含常规接口) ,以及对活动 IBinder 对象的引用,这将导致另一端接收与包裹中的原始 IBinder 连接的代理 IBinder。

<p class=“note”>Parcel is <strong>not</strong-general-purpose> serialization mechanism. 此类 (,用于将任意对象放入包裹) 的相应 Parcelable API 设计为高性能 IPC 传输。 因此,不宜将任何包裹数据放入持久存储:在包中任何数据的基础实现中更改可能会使旧数据不可读。</P>

包裹 API 的大部分内容都围绕读取和写入各种类型的数据展开。 有六个主要类可用的此类函数。

<h3>基元</h3>

最基本的数据函数用于编写和读取基元数据类型:#writeByte、、#readByte#writeDouble#writeInt#readFloat#writeLong#readInt#writeFloat#readDouble、、#readLong、、#writeString、 。 #readString 大多数其他数据操作都是基于这些操作构建的。 使用主机 CPU 的终止性写入和读取给定数据。

<h3>基元数组</h3>

有多种方法可用于读取和写入基元对象的原始数组,这通常会导致写入 4 字节长度,后跟基元数据项。 读取方法可以将数据读取到现有数组中,也可以创建并返回新数组。 这些可用类型包括:

<ul><li>#writeBooleanArray(boolean[])#readBooleanArray(boolean[])#createBooleanArray()<li>#writeByteArray(byte[])#writeByteArray(byte[], int, int)#readByteArray(byte[]), li>#createByteArray()#writeCharArray(char[])<, #readCharArray(char[])#createCharArray()<li>#writeDoubleArray(double[])#readDoubleArray(double[])#createDoubleArray()<li>#writeFloatArray(float[])#readFloatArray(float[]), li>#writeIntArray(int[])#readIntArray(int[])<#createFloatArray()#createIntArray()<li>#writeLongArray(long[])#readLongArray(long[])#createLongArray()<li>#writeStringArray(String[]), , 。 #createStringArray()#readStringArray(String[]) <li>#writeSparseBooleanArray(SparseBooleanArray)#readSparseBooleanArray(). </ul>

<h3>Parcelables</h3>

Parcelable 协议为对象提供了一种非常高效的 (但低级别的) 协议,用于从包中自行写入和读取。 可以使用直接方法和 #writeParcelable(Parcelable, int)#readParcelable(ClassLoader) 或 和 #writeParcelableArray#readParcelableArray(ClassLoader) 进行写入或读取。 这些方法将类类型及其数据写入 Parcel,从而允许在以后读取时从相应的类加载程序重新构造该类。

还有一些方法提供了一种更有效的方法来使用 Parcelables:#writeTypedObject#writeTypedArray#writeTypedList#readTypedObject#createTypedArray#createTypedArrayList。 这些方法不写入原始对象的类信息:相反,read 函数的调用方必须知道预期的类型并传入相应的 Parcelable.Creator Parcelable.Creator ,以便正确构造新对象并读取其数据。 (若要更高效地写入和读取不为 null 的单个 Parcelable 对象,可以直接调用 Parcelable#writeToParcel Parcelable.writeToParcelParcelable.Creator#createFromParcel Parcelable.Creator.createFromParcel 自己。)

<h3>捆绑包</h3>

一个名为 的特殊类型安全容器 Bundle可用于异类值的键/值映射。 这具有许多优化来提高读取和写入数据时的性能,并且其类型安全 API 避免了在最终将数据内容封送到包裹中时难以调试的类型错误。 要使用的 #writeBundle(Bundle)方法是 、 #readBundle()#readBundle(ClassLoader)

<h3>活动对象</h3>

Parcel 的一个不寻常的功能是能够读取和写入活动对象。 对于这些对象,不写入对象的实际内容,而是写入引用对象的特殊标记。 从 Parcel 读取对象时,你不会获得对象的新实例,而是一个对最初写入的完全相同的对象进行操作的句柄。 有两种形式的活动对象可用。

Binder 对象是 Android 常规跨进程通信系统的核心功能。 接口 IBinder 描述具有 Binder 对象的抽象协议。 任何此类接口都可以写入包裹,读取后,你将收到实现该接口的原始对象或将调用传回原始对象的特殊代理实现。 要使用的#writeStrongBinder(IBinder)方法是 、、#writeStrongInterface(IInterface)、、#readStrongBinder()#writeBinderArray(IBinder[])#createBinderArray()#readBinderArray(IBinder[])#createInterfaceArray(IntFunction, Function)#readInterfaceArray(T[], Function)#writeInterfaceArray(T[])#writeBinderList(List)、、 。 #createInterfaceArrayList(Function)#readBinderList(List)#createBinderArrayList()#writeInterfaceList(List)#readInterfaceList(List, Function)

FileDescriptor 对象(表示原始 Linux 文件描述符标识符)可以编写,并 ParcelFileDescriptor 返回对象以对原始文件描述符进行操作。 返回的文件描述符是原始文件描述符的重复项:对象和 fd 不同,但在相同的基础文件流上运行,位置相同,等等。要使用的 #writeFileDescriptor(FileDescriptor)方法是 、 #readFileDescriptor()

<h3>可包裹容器</h3>

最后一类方法用于编写和读取任意类型的标准 Java 容器。 这些都围绕 #writeValue(Object) 定义允许的对象类型的 和 #readValue(ClassLoader) 方法展开。 容器方法是 #writeArray(Object[])、、#readArray(ClassLoader)、、#readList(List, ClassLoader)#writeList(List)#readMap(Map, ClassLoader)#writeMap(Map)#readArrayList(ClassLoader)#writeSparseArray(SparseArray)、、 。 #readSparseArray(ClassLoader)

<h3>受限的可包裹容器</h3>

最后一类方法用于读取受限制类型的标准 Java 容器。 这些方法替换了用于从 Android Build.VERSION_CODES#TIRAMISU开始读取上一部分中任意类型的容器的方法。 配对写入方法仍与上一部分相同。 这些方法接受其他 clazz 参数作为所需类型。 受限制的包裹容器方法是 #readArray(ClassLoader, Class)、、#readList(List, ClassLoader, Class)#readArrayList(ClassLoader, Class)#readMap(Map, ClassLoader, Class, Class)#readSparseArray(ClassLoader, Class)

android.os.ParcelJava 文档。

此页面的部分内容是基于 创建和共享的工作进行的修改,并根据 署名许可中所述的术语使用。

属性

Class

返回此 Object的运行时类。

(继承自 Object)
Handle

基础 Android 实例的句柄。

(继承自 Object)
HasFileDescriptors

报告包裹是否包含任何封送文件描述符。

JniIdentityHashCode

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

(继承自 Object)
JniPeerMembers

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

PeerReference

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

(继承自 Object)
StringCreator
ThresholdClass

此 API 支持 Mono for Android 基础结构,不应直接从代码使用。

(继承自 Object)
ThresholdType

此 API 支持 Mono for Android 基础结构,不应直接从代码使用。

(继承自 Object)

方法

AppendFrom(Parcel, Int32, Int32)
Clone()

创建并返回此对象的副本。

(继承自 Object)
CreateBinderArray()
CreateBinderArrayList()

从当前 dataPosition () 处使用写入 #writeBinderList 的包裹读取并返回包含 IBinder 对象的新 ArrayList。

CreateBooleanArray()
CreateByteArray()

读取并返回包裹中的 byte[] 对象。

CreateCharArray()
CreateDoubleArray()
CreateFixedArray(Class, IFunction, Int32[])

从包裹中读取并返回类型化接口的新多维数组。

CreateFixedArray(Class, Int32[])

从包裹中读取并返回新的多维数组。

CreateFixedArray(Class, IParcelableCreator, Int32[])

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

CreateFloatArray()
CreateIntArray()
CreateInterfaceArray(IIntFunction, IFunction)

从包裹中读取并返回 T (IInterface) 的新数组。

CreateInterfaceArrayList(IFunction)

读取并返回包含 T (IInterface 的新 ArrayList,) 使用当前 dataPosition () 编写的 #writeInterfaceList 包裹中的对象。

CreateLongArray()
CreateStringArray()
CreateStringArrayList()

读取并返回一个新的 ArrayList,其中包含在当前 dataPosition () 处使用 #writeStringList 写入的包裹中的 String 对象。

CreateTypedArray(IParcelableCreator)

从当前 dataPosition () 处的包裹中读取并返回包含特定对象类型的新数组。

CreateTypedArrayList(IParcelableCreator)

从当前 dataPosition () 处使用 写入的包裹中读取 #writeTypedList 并返回包含特定对象类型的新 ArrayList。

CreateTypedArrayMap(IParcelableCreator)

在当前 dataPosition () 中读取包含特定#writeTypedArrayMap(ArrayMap, int)对象类型的具有ArrayMap字符串键的新项。

CreateTypedSparseArray(IParcelableCreator)

读取到包含当前 dataPosition () 处使用#writeTypedSparseArray(SparseArray, int)写入的特定对象类型的新SparseArray项。

DataAvail()

返回要从包裹中读取的剩余数据量。

DataCapacity()

返回包裹中的总空间量。

DataPosition()

返回包裹数据中的当前位置。

DataSize()

返回包裹中包含的数据总量。

Dispose()

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

(继承自 Object)
Dispose(Boolean)

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

(继承自 Object)
EnforceInterface(String)

读取 writeInterfaceToken 编写的标头,并验证它是否与有问题的接口名称匹配。

EnforceNoDataAvail()

验证包裹上没有剩余的字节要读取。

Equals(Object)

指示其他某个对象是否“等于”此对象。

(继承自 Object)
GetHashCode()

返回对象的哈希代码值。

(继承自 Object)
InvokeHasFileDescriptors(Int32, Int32)

报告包裹是否在 和 length定义的offset范围内包含任何封送文件描述符。

JavaFinalize()

当垃圾回收确定不再引用对象时,由对象上的垃圾回收器调用。

(继承自 Object)
Marshall()

返回包裹的原始字节。

Notify()

唤醒正在等待此对象的监视器的单个线程。

(继承自 Object)
NotifyAll()

唤醒正在等待此对象的监视器的所有线程。

(继承自 Object)
Obtain()

从池中检索新的 Parcel 对象。

Obtain(IBinder)

从池中检索要与特定绑定器一起使用的新 Parcel 对象。

ReadArray(ClassLoader)

从当前 dataPosition () 处的包裹中读取并返回新的 Object 数组。

ReadArray(ClassLoader, Class)

与 相同 #readArray(ClassLoader) ,但接受 clazz 参数作为每个项所需的类型。

ReadArrayList(ClassLoader)

从当前 dataPosition () 处的包裹中读取并返回新的 ArrayList 对象。

ReadArrayList(ClassLoader, Class)

与 相同 #readArrayList(ClassLoader) ,但接受 clazz 参数作为每个项所需的类型。

ReadBinderArray(IBinder[])
ReadBinderList(IList<IBinder>)

读取给定列表项 IBinder 对象,这些对象是使用 #writeBinderList 当前 dataPosition () 编写的。

ReadBlob()

从包裹中读取数据 blob,并将其作为字节数组返回。

ReadBoolean()

从当前 dataPosition () 处的包裹中读取布尔值。

ReadBooleanArray(Boolean[])
ReadBundle()

从当前 dataPosition () 处的包裹中读取并返回新的 Bundle 对象。

ReadBundle(ClassLoader)

使用给定的类加载程序从当前 dataPosition () 处的包裹中读取并返回新的 Bundle 对象,以初始化捆绑包的类加载程序,以便以后检索 Parcelable 对象。

ReadByte()

从当前 dataPosition () 处的包裹中读取字节值。

ReadByteArray(Byte[])

从包裹中读取 byte[] 对象,并将其复制到给定的字节数组中。

ReadCharArray(Char[])
ReadDouble()

从当前 dataPosition () 处的宗地读取双精度浮点值。

ReadDoubleArray(Double[])
ReadException()

用于从包裹的标头读取异常结果的特殊函数,将在收到事务结果后使用。

ReadException(Int32, String)

使用给定消息引发异常。

ReadFileDescriptor()

从当前 dataPosition () 处的包裹中读取 FileDescriptor。

ReadFixedArray(Object)

从包裹中读取新的多维数组。

ReadFixedArray(Object, IFunction)

从宗地读取类型化接口的新多维数组。

ReadFixedArray(Object, IParcelableCreator)

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

ReadFloat()

从当前 dataPosition () 处的包裹中读取浮点值。

ReadFloatArray(Single[])
ReadHashMap(ClassLoader)

请改用 #readBundle(ClassLoader) (其数据必须已使用 #writeBundle写入。

ReadHashMap(ClassLoader, Class, Class)

与 相同 #readHashMap(ClassLoader) ,但接受 clazzKeyclazzValue 参数作为每个键和值对所需的类型。

ReadInt()

从当前 dataPosition () 处的包裹中读取整数值。

ReadIntArray(Int32[])
ReadInterfaceArray(Object[], IFunction)

从包裹中读取 T (IInterface) 数组。

ReadInterfaceList(IList, IFunction)

读取给定列表项 IInterface 对象,这些对象是使用 #writeInterfaceList 当前 dataPosition () 编写的。

ReadList(IList, ClassLoader)

使用给定的类加载程序从当前 dataPosition () 处的包裹读取现有 List 对象,以加载任何封闭的 Parcelable。

ReadList(IList, ClassLoader, Class)

与 相同 #readList(List, ClassLoader) ,但接受 clazz 参数作为每个项所需的类型。

ReadLong()

从当前 dataPosition () 处的包裹中读取长整数值。

ReadLongArray(Int64[])
ReadMap(IDictionary, ClassLoader)

请改用 #readBundle(ClassLoader) (其数据必须已使用 #writeBundle写入。

ReadMap(IDictionary, ClassLoader, Class, Class)

与 相同 #readMap(Map, ClassLoader) ,但接受 clazzKeyclazzValue 参数作为每个键和值对所需的类型。

ReadParcelable(ClassLoader)

从包裹中读取并返回新的 Parcelable。

ReadParcelable(ClassLoader, Class)

与 相同 #readParcelable(ClassLoader) ,但接受 clazz 参数作为每个项所需的类型。

ReadParcelableArray(ClassLoader)

从包裹中读取并返回新的 Parcelable 数组。

ReadParcelableArray(ClassLoader, Class)

与 相同 #readParcelableArray(ClassLoader) ,但接受 clazz 参数作为每个项所需的类型。

ReadParcelableCreator(ClassLoader)

读取并返回一个 Parcelable。

ReadParcelableCreator(ClassLoader, Class)

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

ReadParcelableList(IList, ClassLoader)

将位于当前数据位置的对象列表 Parcelable 读取到给定 list的 中。

ReadParcelableList(IList, ClassLoader, Class)

与 相同 #readParcelableList(List, ClassLoader) ,但接受 clazz 参数作为每个项所需的类型。

ReadPersistableBundle()

从当前 dataPosition () 处的包裹中读取并返回新的 Bundle 对象。

ReadPersistableBundle(ClassLoader)

使用给定的类加载程序从当前 dataPosition () 处的包裹中读取并返回新的 Bundle 对象,以初始化捆绑包的类加载程序,以便以后检索 Parcelable 对象。

ReadSerializable()

从包裹中读取并返回新的可序列化对象。

ReadSerializable(ClassLoader, Class)

与 相同 #readSerializable() ,但接受 loaderclazz 参数。

ReadSize()

从当前 dataPosition () 处的包裹中读取大小。

ReadSizeF()

从当前 dataPosition () 处的包裹中读取 SizeF。

ReadSparseArray(ClassLoader)

从当前 dataPosition () 处的包裹中读取并返回新的 SparseArray 对象。

ReadSparseArray(ClassLoader, Class)

与 相同 #readSparseArray(ClassLoader) ,但接受 clazz 参数作为每个项所需的类型。

ReadSparseBooleanArray()

从当前 dataPosition () 处的包裹中读取并返回新的 SparseBooleanArray 对象。

ReadString()

从当前 dataPosition () 处的包裹中读取字符串值。

ReadStringArray(String[])
ReadStringList(IList<String>)

读取给定列表项 String 对象,这些对象是使用 #writeStringList 当前 dataPosition () 编写的。

ReadStrongBinder()

从当前 dataPosition () 处的包裹中读取对象。

ReadTypedArray(Object[], IParcelableCreator)

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

ReadTypedList(IList, IParcelableCreator)

读取给定列表项,其中包含使用 #writeTypedList 当前 dataPosition () 编写的特定对象类型。

ReadTypedObject(IParcelableCreator)

从包裹中读取并返回类型化 Parcelable 对象。

ReadValue(ClassLoader)

从包裹中读取类型化对象。

Recycle()

将一个 Parcel 对象放回池中。

SetDataCapacity(Int32)

更改包裹的当前可用空间 (容量) 。

SetDataPosition(Int32)

移动包裹中的当前读/写位置。

SetDataSize(Int32)

更改包裹中的数据量。

SetHandle(IntPtr, JniHandleOwnership)

设置 Handle 属性。

(继承自 Object)
SetPropagateAllowBlocking()

此方法由 AIDL 编译器用于系统组件。

ToArray<T>()

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

(继承自 Object)
ToString()

返回对象的字符串表示形式。

(继承自 Object)
Unmarshall(Byte[], Int32, Int32)

用提供的数据填充此包裹的原始字节。

UnregisterFromRuntime()

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

(继承自 Object)
Wait()

导致当前线程等待,直到它被唤醒,通常是通过 em <通知/em> 或 <em>interrupted</em>。<>

(继承自 Object)
Wait(Int64)

导致当前线程等待,直到它被唤醒,通常是通过 em <通知/em> 或 <em>interrupted</em>,或直到经过一定数量的实时。<>

(继承自 Object)
Wait(Int64, Int32)

导致当前线程等待,直到它被唤醒,通常是通过 em <通知/em> 或 <em>interrupted</em>,或直到经过一定数量的实时。<>

(继承自 Object)
WriteArray(Object[])

将 Object 数组平展到当前 dataPosition () 处的包裹中,如果需要,会增大 dataCapacity () 。

WriteBinderArray(IBinder[])
WriteBinderList(IList<IBinder>)

根据需要,在当前 dataPosition () 和不断增长的 dataCapacity () 处平展包含 IBinder 对象的列表。

WriteBlob(Byte[])

将一个 Blob 数据写入当前 #dataPosition的包裹中,如果需要,会增长 #dataCapacity

WriteBlob(Byte[], Int32, Int32)

将一个 Blob 数据写入当前 #dataPosition的包裹中,如果需要,会增长 #dataCapacity

WriteBoolean(Boolean)

根据需要,将布尔值写入当前 dataPosition () 处的包中,并增加 dataCapacity () 。

WriteBooleanArray(Boolean[])
WriteBundle(Bundle)

将捆绑包平展到当前 dataPosition () 处的包裹中,根据需要增加 dataCapacity () 。

WriteByte(SByte)

将字节值写入当前 dataPosition () 处的包裹中,如果需要,会增大 dataCapacity () 。

WriteByteArray(Byte[])

将字节数组写入当前 #dataPosition的包裹中,如果需要,会增大 #dataCapacity

WriteByteArray(Byte[], Int32, Int32)

将字节数组写入当前 #dataPosition的包裹中,如果需要,会增大 #dataCapacity

WriteCharArray(Char[])
WriteDouble(Double)

将双精度浮点值写入当前 dataPosition () 处的包裹中,如果需要,会增大 dataCapacity () 。

WriteDoubleArray(Double[])
WriteException(Exception)

用于在包裹的标头写入异常结果的特殊函数,用于从事务返回异常时使用。

WriteFileDescriptor(FileDescriptor)

将 FileDescriptor 写入到当前 dataPosition () 处的包裹中,如果需要,会增大 dataCapacity () 。

WriteFixedArray(Object, Int32, Int32[])

使用固定大小平展同质多维数组。

WriteFloat(Single)

将浮点值写入当前 dataPosition () 处的包裹中,如果需要,会增大 dataCapacity () 。

WriteFloatArray(Single[])
WriteInt(Int32)

将整数值写入当前 dataPosition () 处的包裹中,如果需要,会增大 dataCapacity () 。

WriteIntArray(Int32[])
WriteInterfaceArray(Object[])

根据需要,在当前 dataPosition () 处将包含 IInterface 类型的同质数组平展到包裹中,并根据需要扩展的 dataCapacity () 。

WriteInterfaceList(IList)

将包含 T (IInterface 的) 对象平展 List 到当前位置的此包裹中。

WriteInterfaceToken(String)

在当前 #dataPosition的包裹中存储或读取 IBinder 接口令牌。

WriteList(IList)

将列表平展到当前 dataPosition () 处的包裹中,根据需要增加 dataCapacity () 。

WriteLong(Int64)

将一个长整数值写入当前 dataPosition () 处的包裹中,如果需要,会增大 dataCapacity () 。

WriteLongArray(Int64[])
WriteMap(IDictionary)

请改用 #writeBundle

WriteNoException()

用于在包的前面写入信息的特殊函数,指示未发生异常。

WriteParcelable(IParcelable, ParcelableWriteFlags)

将 Parcelable 类的名称及其内容平展到包裹中。

WriteParcelableArray(Object[], ParcelableWriteFlags)

将一个异类的 Parcelable 对象数组写入到 Parcel 中。

WriteParcelableCreator(IParcelable)

将 Parcelable 的类的名称平展到此包裹中。

WriteParcelableList(IList, Int32)

将包含任意Parcelable对象的 平展List到当前位置的此包裹中。

WritePersistableBundle(PersistableBundle)

根据需要,将 PersistableBundle 平展到当前 dataPosition () 处的包裹中,并增加 dataCapacity () 。

WriteSerializable(ISerializable)

将一个可序列化的泛型对象写入到包裹中。

WriteSize(Size)

根据需要,将大小平展到当前 dataPosition () 处的包裹中,并增加 dataCapacity () 。

WriteSizeF(SizeF)

根据需要,将 SizeF 平展到当前 dataPosition () 处的包裹中,增加 dataCapacity () 。

WriteSparseArray(SparseArray)

根据需要,将泛型 SparseArray 平展到当前 dataPosition () 处的包裹中,并增加 dataCapacity () 。

WriteSparseBooleanArray(SparseBooleanArray)
WriteString(String)

将字符串值写入当前 dataPosition () 处的包裹中,如果需要,会增大 dataCapacity () 。

WriteStringArray(String[])
WriteStringList(IList<String>)

根据需要,在当前 dataPosition () 和不断增长的 dataCapacity () 处平展包含 String 对象的列表。

WriteStrongBinder(IBinder)

根据需要,将对象写入当前 dataPosition () 处的包中,并增加 dataCapacity () 。

WriteStrongInterface(IInterface)

根据需要,将对象写入当前 dataPosition () 处的包中,并增加 dataCapacity () 。

WriteTypedArray(Object[], ParcelableWriteFlags)

根据需要,在当前 dataPosition () 和不断增长的 dataCapacity () 处将包含特定对象类型的同质数组平展到包裹中。

WriteTypedArrayMap(ArrayMap, Int32)

根据需要,使用包含特定对象类型的字符串键平展 ArrayMap 到当前 dataPosition () 和不断增长的 dataCapacity () 的包中。

WriteTypedList(IList)

将包含特定对象类型的列表平展到包裹中,在当前 dataPosition () 处,并根据需要增长的 dataCapacity () 。

WriteTypedList(IList, ParcelableWriteFlags)

将包含特定对象类型的列表平展到包裹中,在当前 dataPosition () 处,并根据需要增长的 dataCapacity () 。

WriteTypedObject(Object, ParcelableWriteFlags)

将 Parcelable 对象平展到包裹中。

WriteTypedSparseArray(SparseArray, Int32)

如果需要, SparseArray 将包含特定对象类型的 平展到当前 dataPosition () 处的宗地中,并增加的 dataCapacity () 。

WriteValue(Object)

将 中的一个泛型对象平展为包裹。

显式接口实现

IJavaPeerable.Disposed()

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

(继承自 Object)
IJavaPeerable.DisposeUnlessReferenced()

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

(继承自 Object)
IJavaPeerable.Finalized()

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

(继承自 Object)
IJavaPeerable.JniManagedPeerState

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

(继承自 Object)
IJavaPeerable.SetJniIdentityHashCode(Int32)

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

(继承自 Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates)

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

(继承自 Object)
IJavaPeerable.SetPeerReference(JniObjectReference)

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

(继承自 Object)

扩展方法

JavaCast<TResult>(IJavaObject)

执行 Android 运行时检查的类型转换。

JavaCast<TResult>(IJavaObject)

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

GetJniTypeName(IJavaPeerable)

消息的容器 (可通过 IBinder 发送的数据和对象引用) 。

适用于