Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Fields](https://developer.android.com/reference/android/os/Parcel#lfields) \| [Methods](https://developer.android.com/reference/android/os/Parcel#pubmethods) \| [Protected Methods](https://developer.android.com/reference/android/os/Parcel#promethods) \| [Inherited Methods](https://developer.android.com/reference/android/os/Parcel#inhmethods)

# Parcel

*** ** * ** ***

` public final class Parcel `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.os.Parcel |

<br />

*** ** * ** ***

Container for a message (data and object references) that can be sent through an IBinder. A Parcel can contain both flattened data that will be unflattened on the other side of the IPC (using the various methods here for writing specific types, or the general `https://developer.android.com/reference/android/os/Parcelable` interface), and references to live `https://developer.android.com/reference/android/os/IBinder` objects that will result in the other side receiving a proxy IBinder connected with the original IBinder in the Parcel.

Parcel is **not** a general-purpose serialization mechanism. This class (and the corresponding `https://developer.android.com/reference/android/os/Parcelable` API for placing arbitrary objects into a Parcel) is designed as a high-performance IPC transport. As such, it is not appropriate to place any Parcel data in to persistent storage: changes in the underlying implementation of any of the data in the Parcel can render older data unreadable.

The bulk of the Parcel API revolves around reading and writing data of various types. There are six major classes of such functions available.

### Primitives

The most basic data functions are for writing and reading primitive data types: `https://developer.android.com/reference/android/os/Parcel#writeByte(byte)`, `https://developer.android.com/reference/android/os/Parcel#readByte()`, `https://developer.android.com/reference/android/os/Parcel#writeDouble(double)`, `https://developer.android.com/reference/android/os/Parcel#readDouble()`, `https://developer.android.com/reference/android/os/Parcel#writeFloat(float)`, `https://developer.android.com/reference/android/os/Parcel#readFloat()`, `https://developer.android.com/reference/android/os/Parcel#writeInt(int)`, `https://developer.android.com/reference/android/os/Parcel#readInt()`, `https://developer.android.com/reference/android/os/Parcel#writeLong(long)`, `https://developer.android.com/reference/android/os/Parcel#readLong()`, `https://developer.android.com/reference/android/os/Parcel#writeString(java.lang.String)`, `https://developer.android.com/reference/android/os/Parcel#readString()`. Most other data operations are built on top of these. The given data is written and read using the endianess of the host CPU.

### Primitive Arrays

There are a variety of methods for reading and writing raw arrays of primitive objects, which generally result in writing a 4-byte length followed by the primitive data items. The methods for reading can either read the data into an existing array, or create and return a new array. These available types are:

- `https://developer.android.com/reference/android/os/Parcel#writeBooleanArray(boolean[])`, `https://developer.android.com/reference/android/os/Parcel#readBooleanArray(boolean[])`, `https://developer.android.com/reference/android/os/Parcel#createBooleanArray()`
- `https://developer.android.com/reference/android/os/Parcel#writeByteArray(byte[])`, `https://developer.android.com/reference/android/os/Parcel#writeByteArray(byte[],%20int,%20int)`, `https://developer.android.com/reference/android/os/Parcel#readByteArray(byte[])`, `https://developer.android.com/reference/android/os/Parcel#createByteArray()`
- `https://developer.android.com/reference/android/os/Parcel#writeCharArray(char[])`, `https://developer.android.com/reference/android/os/Parcel#readCharArray(char[])`, `https://developer.android.com/reference/android/os/Parcel#createCharArray()`
- `https://developer.android.com/reference/android/os/Parcel#writeDoubleArray(double[])`, `https://developer.android.com/reference/android/os/Parcel#readDoubleArray(double[])`, `https://developer.android.com/reference/android/os/Parcel#createDoubleArray()`
- `https://developer.android.com/reference/android/os/Parcel#writeFloatArray(float[])`, `https://developer.android.com/reference/android/os/Parcel#readFloatArray(float[])`, `https://developer.android.com/reference/android/os/Parcel#createFloatArray()`
- `https://developer.android.com/reference/android/os/Parcel#writeIntArray(int[])`, `https://developer.android.com/reference/android/os/Parcel#readIntArray(int[])`, `https://developer.android.com/reference/android/os/Parcel#createIntArray()`
- `https://developer.android.com/reference/android/os/Parcel#writeLongArray(long[])`, `https://developer.android.com/reference/android/os/Parcel#readLongArray(long[])`, `https://developer.android.com/reference/android/os/Parcel#createLongArray()`
- `https://developer.android.com/reference/android/os/Parcel#writeStringArray(java.lang.String[])`, `https://developer.android.com/reference/android/os/Parcel#readStringArray(java.lang.String[])`, `https://developer.android.com/reference/android/os/Parcel#createStringArray()`.
- `https://developer.android.com/reference/android/os/Parcel#writeSparseBooleanArray(android.util.SparseBooleanArray)`, `https://developer.android.com/reference/android/os/Parcel#readSparseBooleanArray()`.

### Parcelables

The `https://developer.android.com/reference/android/os/Parcelable` protocol provides an extremely efficient (but low-level) protocol for objects to write and read themselves from Parcels. You can use the direct methods `https://developer.android.com/reference/android/os/Parcel#writeParcelable(android.os.Parcelable,%20int)` and `https://developer.android.com/reference/android/os/Parcel#readParcelable(java.lang.ClassLoader)` or `https://developer.android.com/reference/android/os/Parcel#writeParcelableArray(T[],%20int)` and `https://developer.android.com/reference/android/os/Parcel#readParcelableArray(java.lang.ClassLoader)` to write or read. These methods write both the class type and its data to the Parcel, allowing that class to be reconstructed from the appropriate class loader when later reading.

There are also some methods that provide a more efficient way to work with Parcelables: `https://developer.android.com/reference/android/os/Parcel#writeTypedObject(T,%20int)`, `https://developer.android.com/reference/android/os/Parcel#writeTypedArray(T[],%20int)`, `https://developer.android.com/reference/android/os/Parcel#writeTypedList(java.util.List<T>)`, `https://developer.android.com/reference/android/os/Parcel#readTypedObject(android.os.Parcelable.Creator<T>)`, `https://developer.android.com/reference/android/os/Parcel#createTypedArray(android.os.Parcelable.Creator<T>)` and `https://developer.android.com/reference/android/os/Parcel#createTypedArrayList(android.os.Parcelable.Creator<T>)`. These methods do not write the class information of the original object: instead, the caller of the read function must know what type to expect and pass in the appropriate `https://developer.android.com/reference/android/os/Parcelable.Creator` instead to properly construct the new object and read its data. (To more efficient write and read a single Parcelable object that is not null, you can directly call `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)` and `https://developer.android.com/reference/android/os/Parcelable.Creator#createFromParcel(android.os.Parcel)` yourself.)

### Bundles

A special type-safe container, called `https://developer.android.com/reference/android/os/Bundle`, is available for key/value maps of heterogeneous values. This has many optimizations for improved performance when reading and writing data, and its type-safe API avoids difficult to debug type errors when finally marshalling the data contents into a Parcel. The methods to use are `https://developer.android.com/reference/android/os/Parcel#writeBundle(android.os.Bundle)`, `https://developer.android.com/reference/android/os/Parcel#readBundle()`, and `https://developer.android.com/reference/android/os/Parcel#readBundle(java.lang.ClassLoader)`.

### Active Objects

An unusual feature of Parcel is the ability to read and write active objects. For these objects the actual contents of the object is not written, rather a special token referencing the object is written. When reading the object back from the Parcel, you do not get a new instance of the object, but rather a handle that operates on the exact same object that was originally written. There are two forms of active objects available.

`https://developer.android.com/reference/android/os/Binder` objects are a core facility of Android's general cross-process communication system. The `https://developer.android.com/reference/android/os/IBinder` interface describes an abstract protocol with a Binder object. Any such interface can be written in to a Parcel, and upon reading you will receive either the original object implementing that interface or a special proxy implementation that communicates calls back to the original object. The methods to use are `https://developer.android.com/reference/android/os/Parcel#writeStrongBinder(android.os.IBinder)`, `https://developer.android.com/reference/android/os/Parcel#writeStrongInterface(android.os.IInterface)`, `https://developer.android.com/reference/android/os/Parcel#readStrongBinder()`, `https://developer.android.com/reference/android/os/Parcel#writeBinderArray(android.os.IBinder[])`, `https://developer.android.com/reference/android/os/Parcel#readBinderArray(android.os.IBinder[])`, `https://developer.android.com/reference/android/os/Parcel#createBinderArray()`, `https://developer.android.com/reference/android/os/Parcel#writeInterfaceArray(T[])`, `https://developer.android.com/reference/android/os/Parcel#readInterfaceArray(T[],%20java.util.function.Function<android.os.IBinder,T>)`, `https://developer.android.com/reference/android/os/Parcel#createInterfaceArray(java.util.function.IntFunction<T[]>,%20java.util.function.Function<android.os.IBinder,T>)`, `https://developer.android.com/reference/android/os/Parcel#writeBinderList(java.util.List<android.os.IBinder>)`, `https://developer.android.com/reference/android/os/Parcel#readBinderList(java.util.List<android.os.IBinder>)`, `https://developer.android.com/reference/android/os/Parcel#createBinderArrayList()`, `https://developer.android.com/reference/android/os/Parcel#writeInterfaceList(java.util.List<T>)`, `https://developer.android.com/reference/android/os/Parcel#readInterfaceList(java.util.List<T>,%20java.util.function.Function<android.os.IBinder,T>)`, `https://developer.android.com/reference/android/os/Parcel#createInterfaceArrayList(java.util.function.Function<android.os.IBinder,T>)`.

FileDescriptor objects, representing raw Linux file descriptor identifiers, can be written and `https://developer.android.com/reference/android/os/ParcelFileDescriptor` objects returned to operate on the original file descriptor. The returned file descriptor is a dup of the original file descriptor: the object and fd is different, but operating on the same underlying file stream, with the same position, etc. The methods to use are `https://developer.android.com/reference/android/os/Parcel#writeFileDescriptor(java.io.FileDescriptor)`, `https://developer.android.com/reference/android/os/Parcel#readFileDescriptor()`.

### Parcelable Containers

A final class of methods are for writing and reading standard Java containers of arbitrary types. These all revolve around the `https://developer.android.com/reference/android/os/Parcel#writeValue(java.lang.Object)` and `https://developer.android.com/reference/android/os/Parcel#readValue(java.lang.ClassLoader)` methods which define the types of objects allowed. The container methods are `https://developer.android.com/reference/android/os/Parcel#writeArray(java.lang.Object[])`, `https://developer.android.com/reference/android/os/Parcel#readArray(java.lang.ClassLoader)`, `https://developer.android.com/reference/android/os/Parcel#writeList(java.util.List)`, `https://developer.android.com/reference/android/os/Parcel#readList(java.util.List,%20java.lang.ClassLoader)`, `https://developer.android.com/reference/android/os/Parcel#readArrayList(java.lang.ClassLoader)`, `https://developer.android.com/reference/android/os/Parcel#writeMap(java.util.Map)`, `https://developer.android.com/reference/android/os/Parcel#readMap(java.util.Map,%20java.lang.ClassLoader)`, `https://developer.android.com/reference/android/os/Parcel#writeSparseArray(android.util.SparseArray<T>)`, `https://developer.android.com/reference/android/os/Parcel#readSparseArray(java.lang.ClassLoader)`.

### Restricted Parcelable Containers

A final class of methods are for reading standard Java containers of restricted types. These methods replace methods for reading containers of arbitrary types from previous section starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. The pairing writing methods are still the same from previous section. These methods accepts additional `clazz` parameters as the required types. The Restricted Parcelable container methods are `https://developer.android.com/reference/android/os/Parcel#readArray(java.lang.ClassLoader,%20java.lang.Class<T>)`, `https://developer.android.com/reference/android/os/Parcel#readList(java.util.List<?%20super%20T>,%20java.lang.ClassLoader,%20java.lang.Class<T>)`, `https://developer.android.com/reference/android/os/Parcel#readArrayList(java.lang.ClassLoader,%20java.lang.Class<?%20extends%20T>)`, `https://developer.android.com/reference/android/os/Parcel#readMap(java.util.Map<?%20super%20K,?%20super%20V>,%20java.lang.ClassLoader,%20java.lang.Class<K>,%20java.lang.Class<V>)`, `https://developer.android.com/reference/android/os/Parcel#readSparseArray(java.lang.ClassLoader,%20java.lang.Class<?%20extends%20T>)`.

## Summary

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/java/lang/String>` | `https://developer.android.com/reference/android/os/Parcel#STRING_CREATOR` <br /> |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#appendFrom(android.os.Parcel,%20int,%20int)(https://developer.android.com/reference/android/os/Parcel parcel, int offset, int length) ` |
| ` https://developer.android.com/reference/android/os/IBinder` | ` https://developer.android.com/reference/android/os/Parcel#createBinderArray()() ` |
| ` https://developer.android.com/reference/java/util/ArrayList<https://developer.android.com/reference/android/os/IBinder>` | ` https://developer.android.com/reference/android/os/Parcel#createBinderArrayList()() ` Read and return a new ArrayList containing IBinder objects from the parcel that was written with `https://developer.android.com/reference/android/os/Parcel#writeBinderList(java.util.List<android.os.IBinder>)` at the current dataPosition(). |
| ` boolean[]` | ` https://developer.android.com/reference/android/os/Parcel#createBooleanArray()() ` |
| ` byte[]` | ` https://developer.android.com/reference/android/os/Parcel#createByteArray()() ` Read and return a byte\[\] object from the parcel. |
| ` char[]` | ` https://developer.android.com/reference/android/os/Parcel#createCharArray()() ` |
| ` double[]` | ` https://developer.android.com/reference/android/os/Parcel#createDoubleArray()() ` |
| ` <T, S extends https://developer.android.com/reference/android/os/IInterface> T` | ` https://developer.android.com/reference/android/os/Parcel#createFixedArray(java.lang.Class<T>,%20java.util.function.Function<android.os.IBinder,S>,%20int[])(https://developer.android.com/reference/java/lang/Class<T> cls, https://developer.android.com/reference/java/util/function/Function<https://developer.android.com/reference/android/os/IBinder, S> asInterface, int... dimensions) ` Read and return a new multi-dimensional array of typed interfaces from a parcel. |
| ` <T, S extends https://developer.android.com/reference/android/os/Parcelable> T` | ` https://developer.android.com/reference/android/os/Parcel#createFixedArray(java.lang.Class<T>,%20android.os.Parcelable.Creator<S>,%20int[])(https://developer.android.com/reference/java/lang/Class<T> cls, https://developer.android.com/reference/android/os/Parcelable.Creator<S> c, int... dimensions) ` Read and return a new multi-dimensional array of typed parcelables from a parcel. |
| ` <T> T` | ` https://developer.android.com/reference/android/os/Parcel#createFixedArray(java.lang.Class<T>,%20int[])(https://developer.android.com/reference/java/lang/Class<T> cls, int... dimensions) ` Read and return a new multi-dimensional array from a parcel. |
| ` float[]` | ` https://developer.android.com/reference/android/os/Parcel#createFloatArray()() ` |
| ` int[]` | ` https://developer.android.com/reference/android/os/Parcel#createIntArray()() ` |
| ` <T extends https://developer.android.com/reference/android/os/IInterface> T[]` | ` https://developer.android.com/reference/android/os/Parcel#createInterfaceArray(java.util.function.IntFunction<T[]>,%20java.util.function.Function<android.os.IBinder,T>)(https://developer.android.com/reference/java/util/function/IntFunction<T[]> newArray, https://developer.android.com/reference/java/util/function/Function<https://developer.android.com/reference/android/os/IBinder, T> asInterface) ` Read and return a new array of T (IInterface) from the parcel. |
| ` <T extends https://developer.android.com/reference/android/os/IInterface> https://developer.android.com/reference/java/util/ArrayList<T>` | ` https://developer.android.com/reference/android/os/Parcel#createInterfaceArrayList(java.util.function.Function<android.os.IBinder,T>)(https://developer.android.com/reference/java/util/function/Function<https://developer.android.com/reference/android/os/IBinder, T> asInterface) ` Read and return a new ArrayList containing T (IInterface) objects from the parcel that was written with `https://developer.android.com/reference/android/os/Parcel#writeInterfaceList(java.util.List<T>)` at the current dataPosition(). |
| ` long[]` | ` https://developer.android.com/reference/android/os/Parcel#createLongArray()() ` |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/os/Parcel#createStringArray()() ` |
| ` https://developer.android.com/reference/java/util/ArrayList<https://developer.android.com/reference/java/lang/String>` | ` https://developer.android.com/reference/android/os/Parcel#createStringArrayList()() ` Read and return a new ArrayList containing String objects from the parcel that was written with `https://developer.android.com/reference/android/os/Parcel#writeStringList(java.util.List<java.lang.String>)` at the current dataPosition(). |
| ` <T> T[]` | ` https://developer.android.com/reference/android/os/Parcel#createTypedArray(android.os.Parcelable.Creator<T>)(https://developer.android.com/reference/android/os/Parcelable.Creator<T> c) ` Read and return a new array containing a particular object type from the parcel at the current dataPosition(). |
| ` <T> https://developer.android.com/reference/java/util/ArrayList<T>` | ` https://developer.android.com/reference/android/os/Parcel#createTypedArrayList(android.os.Parcelable.Creator<T>)(https://developer.android.com/reference/android/os/Parcelable.Creator<T> c) ` Read and return a new ArrayList containing a particular object type from the parcel that was written with `https://developer.android.com/reference/android/os/Parcel#writeTypedList(java.util.List<T>)` at the current dataPosition(). |
| ` <T extends https://developer.android.com/reference/android/os/Parcelable> https://developer.android.com/reference/android/util/ArrayMap<https://developer.android.com/reference/java/lang/String, T>` | ` https://developer.android.com/reference/android/os/Parcel#createTypedArrayMap(android.os.Parcelable.Creator<T>)(https://developer.android.com/reference/android/os/Parcelable.Creator<T> creator) ` Read into a new `https://developer.android.com/reference/android/util/ArrayMap` with string keys items containing a particular object type that were written with `https://developer.android.com/reference/android/os/Parcel#writeTypedArrayMap(android.util.ArrayMap<java.lang.String,T>,%20int)` at the current dataPosition(). |
| ` <T extends https://developer.android.com/reference/android/os/Parcelable> https://developer.android.com/reference/android/util/SparseArray<T>` | ` https://developer.android.com/reference/android/os/Parcel#createTypedSparseArray(android.os.Parcelable.Creator<T>)(https://developer.android.com/reference/android/os/Parcelable.Creator<T> creator) ` Read into a new `https://developer.android.com/reference/android/util/SparseArray` items containing a particular object type that were written with `https://developer.android.com/reference/android/os/Parcel#writeTypedSparseArray(android.util.SparseArray<T>,%20int)` at the current dataPosition(). |
| ` int` | ` https://developer.android.com/reference/android/os/Parcel#dataAvail()() ` Returns the amount of data remaining to be read from the parcel. |
| ` int` | ` https://developer.android.com/reference/android/os/Parcel#dataCapacity()() ` Returns the total amount of space in the parcel. |
| ` int` | ` https://developer.android.com/reference/android/os/Parcel#dataPosition()() ` Returns the current position in the parcel data. |
| ` int` | ` https://developer.android.com/reference/android/os/Parcel#dataSize()() ` Returns the total amount of data contained in the parcel. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#enforceInterface(java.lang.String)(https://developer.android.com/reference/java/lang/String interfaceName) ` Read the header written by writeInterfaceToken and verify it matches the interface name in question. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#enforceNoDataAvail()() ` Verify there are no bytes left to be read on the Parcel. |
| ` boolean` | ` https://developer.android.com/reference/android/os/Parcel#hasFileDescriptors()() ` Report whether the parcel contains any marshalled file descriptors. |
| ` boolean` | ` https://developer.android.com/reference/android/os/Parcel#hasFileDescriptors(int,%20int)(int offset, int length) ` Report whether the parcel contains any marshalled file descriptors in the range defined by `offset` and `length`. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#marshall(java.nio.ByteBuffer)(https://developer.android.com/reference/java/nio/ByteBuffer buffer) ` Writes the raw bytes of the parcel to a buffer. |
| ` byte[]` | ` https://developer.android.com/reference/android/os/Parcel#marshall()() ` Returns the raw bytes of the parcel. |
| ` static https://developer.android.com/reference/android/os/Parcel` | ` https://developer.android.com/reference/android/os/Parcel#obtain()() ` Retrieve a new Parcel object from the pool. |
| ` static https://developer.android.com/reference/android/os/Parcel` | ` https://developer.android.com/reference/android/os/Parcel#obtain(android.os.IBinder)(https://developer.android.com/reference/android/os/IBinder binder) ` Retrieve a new Parcel object from the pool for use with a specific binder. |
| ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/android/os/Parcel#readArray(java.lang.ClassLoader)(https://developer.android.com/reference/java/lang/ClassLoader loader) ` *This method was deprecated in API level 33. Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readArray(java.lang.ClassLoader,%20java.lang.Class<T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Also consider changing the format to use `https://developer.android.com/reference/android/os/Parcel#createTypedArray(android.os.Parcelable.Creator<T>)` if possible (eg. if the items' class is final) since this is also more performant. Note that changing to the latter also requires changing the writes.* |
| ` <T> T[]` | ` https://developer.android.com/reference/android/os/Parcel#readArray(java.lang.ClassLoader,%20java.lang.Class<T>)(https://developer.android.com/reference/java/lang/ClassLoader loader, https://developer.android.com/reference/java/lang/Class<T> clazz) ` Same as `https://developer.android.com/reference/android/os/Parcel#readArray(java.lang.ClassLoader)` but accepts `clazz` parameter as the type required for each item. |
| ` <T> https://developer.android.com/reference/java/util/ArrayList<T>` | ` https://developer.android.com/reference/android/os/Parcel#readArrayList(java.lang.ClassLoader,%20java.lang.Class<?%20extends%20T>)(https://developer.android.com/reference/java/lang/ClassLoader loader, https://developer.android.com/reference/java/lang/Class<? extends T> clazz) ` Same as `https://developer.android.com/reference/android/os/Parcel#readArrayList(java.lang.ClassLoader)` but accepts `clazz` parameter as the type required for each item. |
| ` https://developer.android.com/reference/java/util/ArrayList<E>` | ` https://developer.android.com/reference/android/os/Parcel#readArrayList(java.lang.ClassLoader)(https://developer.android.com/reference/java/lang/ClassLoader loader) ` *This method was deprecated in API level 33. Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readArrayList(java.lang.ClassLoader,%20java.lang.Class<?%20extends%20T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Also consider changing the format to use `https://developer.android.com/reference/android/os/Parcel#createTypedArrayList(android.os.Parcelable.Creator<T>)` if possible (eg. if the items' class is final) since this is also more performant. Note that changing to the latter also requires changing the writes.* |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readBinderArray(android.os.IBinder[])(https://developer.android.com/reference/android/os/IBinder val) ` |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readBinderList(java.util.List<android.os.IBinder>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/os/IBinder> list) ` Read into the given List items IBinder objects that were written with `https://developer.android.com/reference/android/os/Parcel#writeBinderList(java.util.List<android.os.IBinder>)` at the current dataPosition(). |
| ` byte[]` | ` https://developer.android.com/reference/android/os/Parcel#readBlob()() ` Read a blob of data from the parcel and return it as a byte array. |
| ` boolean` | ` https://developer.android.com/reference/android/os/Parcel#readBoolean()() ` Read a boolean value from the parcel at the current dataPosition(). |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readBooleanArray(boolean[])(boolean[] val) ` |
| ` https://developer.android.com/reference/android/os/Bundle` | ` https://developer.android.com/reference/android/os/Parcel#readBundle()() ` Read and return a new Bundle object from the parcel at the current dataPosition(). |
| ` https://developer.android.com/reference/android/os/Bundle` | ` https://developer.android.com/reference/android/os/Parcel#readBundle(java.lang.ClassLoader)(https://developer.android.com/reference/java/lang/ClassLoader loader) ` Read and return a new Bundle object from the parcel at the current dataPosition(), using the given class loader to initialize the class loader of the Bundle for later retrieval of Parcelable objects. |
| ` byte` | ` https://developer.android.com/reference/android/os/Parcel#readByte()() ` Read a byte value from the parcel at the current dataPosition(). |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readByteArray(byte[])(byte[] val) ` Read a byte\[\] object from the parcel and copy it into the given byte array. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readCharArray(char[])(char[] val) ` |
| ` double` | ` https://developer.android.com/reference/android/os/Parcel#readDouble()() ` Read a double precision floating point value from the parcel at the current dataPosition(). |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readDoubleArray(double[])(double[] val) ` |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readException()() ` Special function for reading an exception result from the header of a parcel, to be used after receiving the result of a transaction. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readException(int,%20java.lang.String)(int code, https://developer.android.com/reference/java/lang/String msg) ` Throw an exception with the given message. |
| ` https://developer.android.com/reference/android/os/ParcelFileDescriptor` | ` https://developer.android.com/reference/android/os/Parcel#readFileDescriptor()() ` Read a FileDescriptor from the parcel at the current dataPosition(). |
| ` <T, S extends https://developer.android.com/reference/android/os/Parcelable> void` | ` https://developer.android.com/reference/android/os/Parcel#readFixedArray(T,%20android.os.Parcelable.Creator<S>)(T val, https://developer.android.com/reference/android/os/Parcelable.Creator<S> c) ` Read a new multi-dimensional array of typed parcelables from a parcel. |
| ` <T, S extends https://developer.android.com/reference/android/os/IInterface> void` | ` https://developer.android.com/reference/android/os/Parcel#readFixedArray(T,%20java.util.function.Function<android.os.IBinder,S>)(T val, https://developer.android.com/reference/java/util/function/Function<https://developer.android.com/reference/android/os/IBinder, S> asInterface) ` Read a new multi-dimensional array of typed interfaces from a parcel. |
| ` <T> void` | ` https://developer.android.com/reference/android/os/Parcel#readFixedArray(T)(T val) ` Read a new multi-dimensional array from a parcel. |
| ` float` | ` https://developer.android.com/reference/android/os/Parcel#readFloat()() ` Read a floating point value from the parcel at the current dataPosition(). |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readFloatArray(float[])(float[] val) ` |
| ` https://developer.android.com/reference/java/util/HashMap<K, V>` | ` https://developer.android.com/reference/android/os/Parcel#readHashMap(java.lang.ClassLoader)(https://developer.android.com/reference/java/lang/ClassLoader loader) ` *This method was deprecated in API level 33. Consider using `https://developer.android.com/reference/android/os/Parcel#readBundle(java.lang.ClassLoader)` as stated above, in case this method is still preferred use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readHashMap(java.lang.ClassLoader,%20java.lang.Class<?%20extends%20K>,%20java.lang.Class<?%20extends%20V>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`.* |
| ` <K, V> https://developer.android.com/reference/java/util/HashMap<K, V>` | ` https://developer.android.com/reference/android/os/Parcel#readHashMap(java.lang.ClassLoader,%20java.lang.Class<?%20extends%20K>,%20java.lang.Class<?%20extends%20V>)(https://developer.android.com/reference/java/lang/ClassLoader loader, https://developer.android.com/reference/java/lang/Class<? extends K> clazzKey, https://developer.android.com/reference/java/lang/Class<? extends V> clazzValue) ` Same as `https://developer.android.com/reference/android/os/Parcel#readHashMap(java.lang.ClassLoader)` but accepts `clazzKey` and `clazzValue` parameter as the types required for each key and value pair. |
| ` int` | ` https://developer.android.com/reference/android/os/Parcel#readInt()() ` Read an integer value from the parcel at the current dataPosition(). |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readIntArray(int[])(int[] val) ` |
| ` <T extends https://developer.android.com/reference/android/os/IInterface> void` | ` https://developer.android.com/reference/android/os/Parcel#readInterfaceArray(T[],%20java.util.function.Function<android.os.IBinder,T>)(T[] val, https://developer.android.com/reference/java/util/function/Function<https://developer.android.com/reference/android/os/IBinder, T> asInterface) ` Read an array of T (IInterface) from a parcel. |
| ` <T extends https://developer.android.com/reference/android/os/IInterface> void` | ` https://developer.android.com/reference/android/os/Parcel#readInterfaceList(java.util.List<T>,%20java.util.function.Function<android.os.IBinder,T>)(https://developer.android.com/reference/java/util/List<T> list, https://developer.android.com/reference/java/util/function/Function<https://developer.android.com/reference/android/os/IBinder, T> asInterface) ` Read into the given List items IInterface objects that were written with `https://developer.android.com/reference/android/os/Parcel#writeInterfaceList(java.util.List<T>)` at the current dataPosition(). |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readList(java.util.List,%20java.lang.ClassLoader)(https://developer.android.com/reference/java/util/List<E> outVal, https://developer.android.com/reference/java/lang/ClassLoader loader) ` *This method was deprecated in API level 33. Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readList(java.util.List<?%20super%20T>,%20java.lang.ClassLoader,%20java.lang.Class<T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Also consider changing the format to use `https://developer.android.com/reference/android/os/Parcel#readTypedList(java.util.List<T>,%20android.os.Parcelable.Creator<T>)` if possible (eg. if the items' class is final) since this is also more performant. Note that changing to the latter also requires changing the writes.* |
| ` <T> void` | ` https://developer.android.com/reference/android/os/Parcel#readList(java.util.List<?%20super%20T>,%20java.lang.ClassLoader,%20java.lang.Class<T>)(https://developer.android.com/reference/java/util/List<? super T> outVal, https://developer.android.com/reference/java/lang/ClassLoader loader, https://developer.android.com/reference/java/lang/Class<T> clazz) ` Same as `https://developer.android.com/reference/android/os/Parcel#readList(java.util.List,%20java.lang.ClassLoader)` but accepts `clazz` parameter as the type required for each item. |
| ` long` | ` https://developer.android.com/reference/android/os/Parcel#readLong()() ` Read a long integer value from the parcel at the current dataPosition(). |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readLongArray(long[])(long[] val) ` |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readMap(java.util.Map,%20java.lang.ClassLoader)(https://developer.android.com/reference/java/util/Map<K, V> outVal, https://developer.android.com/reference/java/lang/ClassLoader loader) ` *This method was deprecated in API level 33. Consider using `https://developer.android.com/reference/android/os/Parcel#readBundle(java.lang.ClassLoader)` as stated above, in case this method is still preferred use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readMap(java.util.Map<?%20super%20K,?%20super%20V>,%20java.lang.ClassLoader,%20java.lang.Class<K>,%20java.lang.Class<V>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`.* |
| ` <K, V> void` | ` https://developer.android.com/reference/android/os/Parcel#readMap(java.util.Map<?%20super%20K,?%20super%20V>,%20java.lang.ClassLoader,%20java.lang.Class<K>,%20java.lang.Class<V>)(https://developer.android.com/reference/java/util/Map<? super K, ? super V> outVal, https://developer.android.com/reference/java/lang/ClassLoader loader, https://developer.android.com/reference/java/lang/Class<K> clazzKey, https://developer.android.com/reference/java/lang/Class<V> clazzValue) ` Same as `https://developer.android.com/reference/android/os/Parcel#readMap(java.util.Map,%20java.lang.ClassLoader)` but accepts `clazzKey` and `clazzValue` parameter as the types required for each key and value pair. |
| ` <T extends https://developer.android.com/reference/android/os/Parcelable> T` | ` https://developer.android.com/reference/android/os/Parcel#readParcelable(java.lang.ClassLoader)(https://developer.android.com/reference/java/lang/ClassLoader loader) ` *This method was deprecated in API level 33. Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readParcelable(java.lang.ClassLoader,%20java.lang.Class<T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Also consider changing the format to use `https://developer.android.com/reference/android/os/Parcelable.Creator#createFromParcel(android.os.Parcel)` if possible since this is also more performant. Note that changing to the latter also requires changing the writes.* |
| ` <T> T` | ` https://developer.android.com/reference/android/os/Parcel#readParcelable(java.lang.ClassLoader,%20java.lang.Class<T>)(https://developer.android.com/reference/java/lang/ClassLoader loader, https://developer.android.com/reference/java/lang/Class<T> clazz) ` Same as `https://developer.android.com/reference/android/os/Parcel#readParcelable(java.lang.ClassLoader)` but accepts `clazz` parameter as the type required for each item. |
| ` <T> T[]` | ` https://developer.android.com/reference/android/os/Parcel#readParcelableArray(java.lang.ClassLoader,%20java.lang.Class<T>)(https://developer.android.com/reference/java/lang/ClassLoader loader, https://developer.android.com/reference/java/lang/Class<T> clazz) ` Same as `https://developer.android.com/reference/android/os/Parcel#readParcelableArray(java.lang.ClassLoader)` but accepts `clazz` parameter as the type required for each item. |
| ` https://developer.android.com/reference/android/os/Parcelable` | ` https://developer.android.com/reference/android/os/Parcel#readParcelableArray(java.lang.ClassLoader)(https://developer.android.com/reference/java/lang/ClassLoader loader) ` *This method was deprecated in API level 33. Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readParcelableArray(java.lang.ClassLoader,%20java.lang.Class<T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Also consider changing the format to use `https://developer.android.com/reference/android/os/Parcel#createTypedArray(android.os.Parcelable.Creator<T>)` if possible (eg. if the items' class is final) since this is also more performant. Note that changing to the latter also requires changing the writes.* |
| ` https://developer.android.com/reference/android/os/Parcelable.Creator<?>` | ` https://developer.android.com/reference/android/os/Parcel#readParcelableCreator(java.lang.ClassLoader)(https://developer.android.com/reference/java/lang/ClassLoader loader) ` *This method was deprecated in API level 33. Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readParcelableCreator(java.lang.ClassLoader,%20java.lang.Class<T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`.* |
| ` <T> https://developer.android.com/reference/android/os/Parcelable.Creator<T>` | ` https://developer.android.com/reference/android/os/Parcel#readParcelableCreator(java.lang.ClassLoader,%20java.lang.Class<T>)(https://developer.android.com/reference/java/lang/ClassLoader loader, https://developer.android.com/reference/java/lang/Class<T> clazz) ` Same as `https://developer.android.com/reference/android/os/Parcel#readParcelableCreator(java.lang.ClassLoader)` but accepts `clazz` parameter as the required type. |
| ` <T> https://developer.android.com/reference/java/util/List<T>` | ` https://developer.android.com/reference/android/os/Parcel#readParcelableList(java.util.List<T>,%20java.lang.ClassLoader,%20java.lang.Class<?%20extends%20T>)(https://developer.android.com/reference/java/util/List<T> list, https://developer.android.com/reference/java/lang/ClassLoader cl, https://developer.android.com/reference/java/lang/Class<? extends T> clazz) ` Same as `https://developer.android.com/reference/android/os/Parcel#readParcelableList(java.util.List<T>,%20java.lang.ClassLoader)` but accepts `clazz` parameter as the type required for each item. |
| ` <T extends https://developer.android.com/reference/android/os/Parcelable> https://developer.android.com/reference/java/util/List<T>` | ` https://developer.android.com/reference/android/os/Parcel#readParcelableList(java.util.List<T>,%20java.lang.ClassLoader)(https://developer.android.com/reference/java/util/List<T> list, https://developer.android.com/reference/java/lang/ClassLoader cl) ` *This method was deprecated in API level 33. Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readParcelableList(java.util.List<T>,%20java.lang.ClassLoader,%20java.lang.Class<?%20extends%20T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Also consider changing the format to use `https://developer.android.com/reference/android/os/Parcel#readTypedList(java.util.List<T>,%20android.os.Parcelable.Creator<T>)` if possible (eg. if the items' class is final) since this is also more performant. Note that changing to the latter also requires changing the writes.* |
| ` https://developer.android.com/reference/android/os/PersistableBundle` | ` https://developer.android.com/reference/android/os/Parcel#readPersistableBundle()() ` Read and return a new Bundle object from the parcel at the current dataPosition(). |
| ` https://developer.android.com/reference/android/os/PersistableBundle` | ` https://developer.android.com/reference/android/os/Parcel#readPersistableBundle(java.lang.ClassLoader)(https://developer.android.com/reference/java/lang/ClassLoader loader) ` Read and return a new Bundle object from the parcel at the current dataPosition(), using the given class loader to initialize the class loader of the Bundle for later retrieval of Parcelable objects. |
| ` https://developer.android.com/reference/java/io/Serializable` | ` https://developer.android.com/reference/android/os/Parcel#readSerializable()() ` *This method was deprecated in API level 33. Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readSerializable(java.lang.ClassLoader,%20java.lang.Class<T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`.* |
| ` <T> T` | ` https://developer.android.com/reference/android/os/Parcel#readSerializable(java.lang.ClassLoader,%20java.lang.Class<T>)(https://developer.android.com/reference/java/lang/ClassLoader loader, https://developer.android.com/reference/java/lang/Class<T> clazz) ` Same as `https://developer.android.com/reference/android/os/Parcel#readSerializable()` but accepts `loader` and `clazz` parameters. |
| ` https://developer.android.com/reference/android/util/Size` | ` https://developer.android.com/reference/android/os/Parcel#readSize()() ` Read a Size from the parcel at the current dataPosition(). |
| ` https://developer.android.com/reference/android/util/SizeF` | ` https://developer.android.com/reference/android/os/Parcel#readSizeF()() ` Read a SizeF from the parcel at the current dataPosition(). |
| ` <T> https://developer.android.com/reference/android/util/SparseArray<T>` | ` https://developer.android.com/reference/android/os/Parcel#readSparseArray(java.lang.ClassLoader)(https://developer.android.com/reference/java/lang/ClassLoader loader) ` *This method was deprecated in API level 33. Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readSparseArray(java.lang.ClassLoader,%20java.lang.Class<?%20extends%20T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Also consider changing the format to use `https://developer.android.com/reference/android/os/Parcel#createTypedSparseArray(android.os.Parcelable.Creator<T>)` if possible (eg. if the items' class is final) since this is also more performant. Note that changing to the latter also requires changing the writes.* |
| ` <T> https://developer.android.com/reference/android/util/SparseArray<T>` | ` https://developer.android.com/reference/android/os/Parcel#readSparseArray(java.lang.ClassLoader,%20java.lang.Class<?%20extends%20T>)(https://developer.android.com/reference/java/lang/ClassLoader loader, https://developer.android.com/reference/java/lang/Class<? extends T> clazz) ` Same as `https://developer.android.com/reference/android/os/Parcel#readSparseArray(java.lang.ClassLoader)` but accepts `clazz` parameter as the type required for each item. |
| ` https://developer.android.com/reference/android/util/SparseBooleanArray` | ` https://developer.android.com/reference/android/os/Parcel#readSparseBooleanArray()() ` Read and return a new SparseBooleanArray object from the parcel at the current dataPosition(). |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/os/Parcel#readString()() ` Read a string value from the parcel at the current dataPosition(). |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readStringArray(java.lang.String[])(https://developer.android.com/reference/java/lang/String val) ` |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#readStringList(java.util.List<java.lang.String>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String> list) ` Read into the given List items String objects that were written with `https://developer.android.com/reference/android/os/Parcel#writeStringList(java.util.List<java.lang.String>)` at the current dataPosition(). |
| ` https://developer.android.com/reference/android/os/IBinder` | ` https://developer.android.com/reference/android/os/Parcel#readStrongBinder()() ` Read an object from the parcel at the current dataPosition(). |
| ` <T> void` | ` https://developer.android.com/reference/android/os/Parcel#readTypedArray(T[],%20android.os.Parcelable.Creator<T>)(T[] val, https://developer.android.com/reference/android/os/Parcelable.Creator<T> c) ` |
| ` <T> void` | ` https://developer.android.com/reference/android/os/Parcel#readTypedList(java.util.List<T>,%20android.os.Parcelable.Creator<T>)(https://developer.android.com/reference/java/util/List<T> list, https://developer.android.com/reference/android/os/Parcelable.Creator<T> c) ` Read into the given List items containing a particular object type that were written with `https://developer.android.com/reference/android/os/Parcel#writeTypedList(java.util.List<T>)` at the current dataPosition(). |
| ` <T> T` | ` https://developer.android.com/reference/android/os/Parcel#readTypedObject(android.os.Parcelable.Creator<T>)(https://developer.android.com/reference/android/os/Parcelable.Creator<T> c) ` Read and return a typed Parcelable object from a parcel. |
| ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/android/os/Parcel#readValue(java.lang.ClassLoader)(https://developer.android.com/reference/java/lang/ClassLoader loader) ` Read a typed object from a parcel. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#recycle()() ` Put a Parcel object back into the pool. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#setDataCapacity(int)(int size) ` Change the capacity (current available space) of the parcel. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#setDataPosition(int)(int pos) ` Move the current read/write position in the parcel. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#setDataSize(int)(int size) ` Change the amount of data in the parcel. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#setPropagateAllowBlocking()() ` This method is used by the AIDL compiler for system components. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#unmarshall(byte[],%20int,%20int)(byte[] data, int offset, int length) ` Fills the raw bytes of this Parcel with the supplied data. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#unmarshall(java.nio.ByteBuffer)(https://developer.android.com/reference/java/nio/ByteBuffer buffer) ` Fills the raw bytes of this Parcel with data from the supplied buffer. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeArray(java.lang.Object[])(https://developer.android.com/reference/java/lang/Object val) ` Flatten an Object array into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeBinderArray(android.os.IBinder[])(https://developer.android.com/reference/android/os/IBinder val) ` |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeBinderList(java.util.List<android.os.IBinder>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/os/IBinder> val) ` Flatten a List containing IBinder objects into the parcel, at the current dataPosition() and growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeBlob(byte[])(byte[] b) ` Write a blob of data into the parcel at the current `https://developer.android.com/reference/android/os/Parcel#dataPosition()`, growing `https://developer.android.com/reference/android/os/Parcel#dataCapacity()` if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeBlob(byte[],%20int,%20int)(byte[] b, int offset, int len) ` Write a blob of data into the parcel at the current `https://developer.android.com/reference/android/os/Parcel#dataPosition()`, growing `https://developer.android.com/reference/android/os/Parcel#dataCapacity()` if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeBoolean(boolean)(boolean val) ` Write a boolean value into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeBooleanArray(boolean[])(boolean[] val) ` |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeBundle(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle val) ` Flatten a Bundle into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeByte(byte)(byte val) ` Write a byte value into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeByteArray(byte[])(byte[] b) ` Write a byte array into the parcel at the current `https://developer.android.com/reference/android/os/Parcel#dataPosition()`, growing `https://developer.android.com/reference/android/os/Parcel#dataCapacity()` if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeByteArray(byte[],%20int,%20int)(byte[] b, int offset, int len) ` Write a byte array into the parcel at the current `https://developer.android.com/reference/android/os/Parcel#dataPosition()`, growing `https://developer.android.com/reference/android/os/Parcel#dataCapacity()` if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeCharArray(char[])(char[] val) ` |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeDouble(double)(double val) ` Write a double precision floating point value into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeDoubleArray(double[])(double[] val) ` |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeException(java.lang.Exception)(https://developer.android.com/reference/java/lang/Exception e) ` Special function for writing an exception result at the header of a parcel, to be used when returning an exception from a transaction. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeFileDescriptor(java.io.FileDescriptor)(https://developer.android.com/reference/java/io/FileDescriptor val) ` Write a FileDescriptor into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` <T> void` | ` https://developer.android.com/reference/android/os/Parcel#writeFixedArray(T,%20int,%20int[])(T val, int parcelableFlags, int... dimensions) ` Flatten a homogeneous multi-dimensional array with fixed-size. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeFloat(float)(float val) ` Write a floating point value into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeFloatArray(float[])(float[] val) ` |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeInt(int)(int val) ` Write an integer value into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeIntArray(int[])(int[] val) ` |
| ` <T extends https://developer.android.com/reference/android/os/IInterface> void` | ` https://developer.android.com/reference/android/os/Parcel#writeInterfaceArray(T[])(T[] val) ` Flatten a homogeneous array containing an IInterface type into the parcel, at the current dataPosition() and growing dataCapacity() if needed. |
| ` <T extends https://developer.android.com/reference/android/os/IInterface> void` | ` https://developer.android.com/reference/android/os/Parcel#writeInterfaceList(java.util.List<T>)(https://developer.android.com/reference/java/util/List<T> val) ` Flatten a `List` containing T (IInterface) objects into this parcel at the current position. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeInterfaceToken(java.lang.String)(https://developer.android.com/reference/java/lang/String interfaceName) ` Store or read an IBinder interface token in the parcel at the current `https://developer.android.com/reference/android/os/Parcel#dataPosition()`. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeList(java.util.List)(https://developer.android.com/reference/java/util/List<E> val) ` Flatten a List into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeLong(long)(long val) ` Write a long integer value into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeLongArray(long[])(long[] val) ` |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeMap(java.util.Map)(https://developer.android.com/reference/java/util/Map<K, V> val) ` Please use `https://developer.android.com/reference/android/os/Parcel#writeBundle(android.os.Bundle)` instead. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeNoException()() ` Special function for writing information at the front of the Parcel indicating that no exception occurred. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeParcelable(android.os.Parcelable,%20int)(https://developer.android.com/reference/android/os/Parcelable p, int parcelableFlags) ` Flatten the name of the class of the Parcelable and its contents into the parcel. |
| ` <T extends https://developer.android.com/reference/android/os/Parcelable> void` | ` https://developer.android.com/reference/android/os/Parcel#writeParcelableArray(T[],%20int)(T[] value, int parcelableFlags) ` Write a heterogeneous array of Parcelable objects into the Parcel. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeParcelableCreator(android.os.Parcelable)(https://developer.android.com/reference/android/os/Parcelable p) ` Flatten the name of the class of the Parcelable into this Parcel. |
| ` <T extends https://developer.android.com/reference/android/os/Parcelable> void` | ` https://developer.android.com/reference/android/os/Parcel#writeParcelableList(java.util.List<T>,%20int)(https://developer.android.com/reference/java/util/List<T> val, int flags) ` Flatten a `List` containing arbitrary `Parcelable` objects into this parcel at the current position. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writePersistableBundle(android.os.PersistableBundle)(https://developer.android.com/reference/android/os/PersistableBundle val) ` Flatten a PersistableBundle into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeSerializable(java.io.Serializable)(https://developer.android.com/reference/java/io/Serializable s) ` Write a generic serializable object in to a Parcel. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeSize(android.util.Size)(https://developer.android.com/reference/android/util/Size val) ` Flatten a Size into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeSizeF(android.util.SizeF)(https://developer.android.com/reference/android/util/SizeF val) ` Flatten a SizeF into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` <T> void` | ` https://developer.android.com/reference/android/os/Parcel#writeSparseArray(android.util.SparseArray<T>)(https://developer.android.com/reference/android/util/SparseArray<T> val) ` Flatten a generic SparseArray into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeSparseBooleanArray(android.util.SparseBooleanArray)(https://developer.android.com/reference/android/util/SparseBooleanArray val) ` |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeString(java.lang.String)(https://developer.android.com/reference/java/lang/String val) ` Write a string value into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeStringArray(java.lang.String[])(https://developer.android.com/reference/java/lang/String val) ` |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeStringList(java.util.List<java.lang.String>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String> val) ` Flatten a List containing String objects into the parcel, at the current dataPosition() and growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeStrongBinder(android.os.IBinder)(https://developer.android.com/reference/android/os/IBinder val) ` Write an object into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeStrongInterface(android.os.IInterface)(https://developer.android.com/reference/android/os/IInterface val) ` Write an object into the parcel at the current dataPosition(), growing dataCapacity() if needed. |
| ` <T extends https://developer.android.com/reference/android/os/Parcelable> void` | ` https://developer.android.com/reference/android/os/Parcel#writeTypedArray(T[],%20int)(T[] val, int parcelableFlags) ` Flatten a homogeneous array containing a particular object type into the parcel, at the current dataPosition() and growing dataCapacity() if needed. |
| ` <T extends https://developer.android.com/reference/android/os/Parcelable> void` | ` https://developer.android.com/reference/android/os/Parcel#writeTypedArrayMap(android.util.ArrayMap<java.lang.String,T>,%20int)(https://developer.android.com/reference/android/util/ArrayMap<https://developer.android.com/reference/java/lang/String, T> val, int parcelableFlags) ` Flatten an `https://developer.android.com/reference/android/util/ArrayMap` with string keys containing a particular object type into the parcel at the current dataPosition() and growing dataCapacity() if needed. |
| ` <T extends https://developer.android.com/reference/android/os/Parcelable> void` | ` https://developer.android.com/reference/android/os/Parcel#writeTypedList(java.util.List<T>,%20int)(https://developer.android.com/reference/java/util/List<T> val, int parcelableFlags) ` Flatten a List containing a particular object type into the parcel, at the current dataPosition() and growing dataCapacity() if needed. |
| ` <T extends https://developer.android.com/reference/android/os/Parcelable> void` | ` https://developer.android.com/reference/android/os/Parcel#writeTypedList(java.util.List<T>)(https://developer.android.com/reference/java/util/List<T> val) ` Flatten a List containing a particular object type into the parcel, at the current dataPosition() and growing dataCapacity() if needed. |
| ` <T extends https://developer.android.com/reference/android/os/Parcelable> void` | ` https://developer.android.com/reference/android/os/Parcel#writeTypedObject(T,%20int)(T val, int parcelableFlags) ` Flatten the Parcelable object into the parcel. |
| ` <T extends https://developer.android.com/reference/android/os/Parcelable> void` | ` https://developer.android.com/reference/android/os/Parcel#writeTypedSparseArray(android.util.SparseArray<T>,%20int)(https://developer.android.com/reference/android/util/SparseArray<T> val, int parcelableFlags) ` Flatten a `https://developer.android.com/reference/android/util/SparseArray` containing a particular object type into the parcel at the current dataPosition() and growing dataCapacity() if needed. |
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#writeValue(java.lang.Object)(https://developer.android.com/reference/java/lang/Object v) ` Flatten a generic object in to a parcel. |

| ### Protected methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/os/Parcel#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Fields

### STRING_CREATOR

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<String> STRING_CREATOR
```

<br />

<br />

## Public methods

### appendFrom

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void appendFrom (Parcel parcel, 
                int offset, 
                int length)
```

<br />

<br />

| Parameters ||
|---|---|
| `parcel` | `Parcel` <br /> |
| `offset` | `int` <br /> |
| `length` | `int` <br /> |

### createBinderArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public IBinder[] createBinderArray ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/IBinder` | This value may be `null`. <br /> |

### createBinderArrayList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ArrayList<IBinder> createBinderArrayList ()
```

Read and return a new ArrayList containing IBinder objects from the parcel that was written with `https://developer.android.com/reference/android/os/Parcel#writeBinderList(java.util.List<android.os.IBinder>)` at the current dataPosition(). Returns null if the previously written list object was null.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/ArrayList<https://developer.android.com/reference/android/os/IBinder>` | A newly created ArrayList containing strings with the same data as those that were previously written. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeBinderList(java.util.List<android.os.IBinder>)`

### createBooleanArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean[] createBooleanArray ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean[]` | This value may be `null`. <br /> |

### createByteArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public byte[] createByteArray ()
```

Read and return a byte\[\] object from the parcel.

<br />

| Returns ||
|---|---|
| `byte[]` | This value may be `null`. <br /> |

### createCharArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public char[] createCharArray ()
```

<br />

<br />

| Returns ||
|---|---|
| `char[]` | This value may be `null`. <br /> |

### createDoubleArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public double[] createDoubleArray ()
```

<br />

<br />

| Returns ||
|---|---|
| `double[]` | This value may be `null`. <br /> |

### createFixedArray

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public T createFixedArray (Class<T> cls, 
                Function<IBinder, S> asInterface, 
                int... dimensions)
```

Read and return a new multi-dimensional array of typed interfaces from a parcel. Returns null if the previously written array object is null. If you want to read Parcelable values, use `https://developer.android.com/reference/android/os/Parcel#createFixedArray(java.lang.Class<T>,%20android.os.Parcelable.Creator<S>,%20int[])`. For values of other types use `https://developer.android.com/reference/android/os/Parcel#createFixedArray(java.lang.Class<T>,%20int[])`.

<br />

| Parameters ||
|---|---|
| `cls` | `Class`: the Class object for the target array type. (e.g. IFoo\[\]\[\].class). This value cannot be `null`. <br /> |
| `asInterface` | `Function`: This value cannot be `null`. <br /> |
| `dimensions` | `int`: an array of int representing length of each dimension. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `T` | <br /> |

### createFixedArray

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public T createFixedArray (Class<T> cls, 
                Creator<S> c, 
                int... dimensions)
```

Read and return a new multi-dimensional array of typed parcelables from a parcel. Returns null if the previously written array object is null. If you want to read IInterface values, use `https://developer.android.com/reference/android/os/Parcel#createFixedArray(java.lang.Class<T>,%20java.util.function.Function<android.os.IBinder,S>,%20int[])`. For values of other types use `https://developer.android.com/reference/android/os/Parcel#createFixedArray(java.lang.Class<T>,%20int[])`.

<br />

| Parameters ||
|---|---|
| `cls` | `Class`: the Class object for the target array type. (e.g. Foo\[\]\[\].class). This value cannot be `null`. <br /> |
| `c` | `Creator`: This value cannot be `null`. <br /> |
| `dimensions` | `int`: an array of int representing length of each dimension. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `T` | <br /> |

### createFixedArray

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public T createFixedArray (Class<T> cls, 
                int... dimensions)
```

Read and return a new multi-dimensional array from a parcel. Returns null if the previously written array object is null. If you want to read Parcelable or IInterface values, use `https://developer.android.com/reference/android/os/Parcel#createFixedArray(java.lang.Class<T>,%20android.os.Parcelable.Creator<S>,%20int[])` or `https://developer.android.com/reference/android/os/Parcel#createFixedArray(java.lang.Class<T>,%20java.util.function.Function<android.os.IBinder,S>,%20int[])`.

<br />

| Parameters ||
|---|---|
| `cls` | `Class`: the Class object for the target array type. (e.g. int\[\]\[\].class). This value cannot be `null`. <br /> |
| `dimensions` | `int`: an array of int representing length of each dimension. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `T` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeTypedArray(T[],%20int)`
- `https://developer.android.com/reference/android/os/Parcel#createBooleanArray()`
- `https://developer.android.com/reference/android/os/Parcel#createByteArray()`
- `https://developer.android.com/reference/android/os/Parcel#createCharArray()`
- `https://developer.android.com/reference/android/os/Parcel#createIntArray()`
- `https://developer.android.com/reference/android/os/Parcel#createLongArray()`
- `https://developer.android.com/reference/android/os/Parcel#createFloatArray()`
- `https://developer.android.com/reference/android/os/Parcel#createDoubleArray()`
- `https://developer.android.com/reference/android/os/Parcel#createBinderArray()`
- `https://developer.android.com/reference/android/os/Parcel#createInterfaceArray(java.util.function.IntFunction<T[]>,%20java.util.function.Function<android.os.IBinder,T>)`
- `https://developer.android.com/reference/android/os/Parcel#createTypedArray(android.os.Parcelable.Creator<T>)`

### createFloatArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float[] createFloatArray ()
```

<br />

<br />

| Returns ||
|---|---|
| `float[]` | This value may be `null`. <br /> |

### createIntArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int[] createIntArray ()
```

<br />

<br />

| Returns ||
|---|---|
| `int[]` | This value may be `null`. <br /> |

### createInterfaceArray

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public T[] createInterfaceArray (IntFunction<T[]> newArray, 
                Function<IBinder, T> asInterface)
```

Read and return a new array of T (IInterface) from the parcel.

<br />

| Parameters ||
|---|---|
| `newArray` | `IntFunction`: a function to create an array of T with a given length. This value cannot be `null`. <br /> |
| `asInterface` | `Function`: a function to convert IBinder object into T (IInterface). This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `T[]` | the IInterface array of type T. This value may be `null`. <br /> |

### createInterfaceArrayList

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ArrayList<T> createInterfaceArrayList (Function<IBinder, T> asInterface)
```

Read and return a new ArrayList containing T (IInterface) objects from the parcel that was written with `https://developer.android.com/reference/android/os/Parcel#writeInterfaceList(java.util.List<T>)` at the current dataPosition(). Returns null if the previously written list object was null.

<br />

| Parameters ||
|---|---|
| `asInterface` | `Function`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/ArrayList<T>` | A newly created ArrayList containing T (IInterface) <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeInterfaceList(java.util.List<T>)`

### createLongArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long[] createLongArray ()
```

<br />

<br />

| Returns ||
|---|---|
| `long[]` | This value may be `null`. <br /> |

### createStringArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] createStringArray ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value may be `null`. <br /> |

### createStringArrayList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ArrayList<String> createStringArrayList ()
```

Read and return a new ArrayList containing String objects from the parcel that was written with `https://developer.android.com/reference/android/os/Parcel#writeStringList(java.util.List<java.lang.String>)` at the current dataPosition(). Returns null if the previously written list object was null.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/ArrayList<https://developer.android.com/reference/java/lang/String>` | A newly created ArrayList containing strings with the same data as those that were previously written. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeStringList(java.util.List<java.lang.String>)`

### createTypedArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public T[] createTypedArray (Creator<T> c)
```

Read and return a new array containing a particular object type from the parcel at the current dataPosition(). Returns null if the previously written array was null. The array *must* have previously been written via `https://developer.android.com/reference/android/os/Parcel#writeTypedArray(T[],%20int)` with the same object type.

<br />

| Parameters ||
|---|---|
| `c` | `Creator`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `T[]` | A newly created array containing objects with the same data as those that were previously written. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeTypedArray(T[],%20int)`

### createTypedArrayList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ArrayList<T> createTypedArrayList (Creator<T> c)
```

Read and return a new ArrayList containing a particular object type from the parcel that was written with `https://developer.android.com/reference/android/os/Parcel#writeTypedList(java.util.List<T>)` at the current dataPosition(). Returns null if the previously written list object was null. The list *must* have previously been written via `https://developer.android.com/reference/android/os/Parcel#writeTypedList(java.util.List<T>)` with the same object type.

<br />

| Parameters ||
|---|---|
| `c` | `Creator`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/ArrayList<T>` | A newly created ArrayList containing objects with the same data as those that were previously written. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeTypedList(java.util.List<T>)`

### createTypedArrayMap

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ArrayMap<String, T> createTypedArrayMap (Creator<T> creator)
```

Read into a new `https://developer.android.com/reference/android/util/ArrayMap` with string keys items containing a particular object type that were written with `https://developer.android.com/reference/android/os/Parcel#writeTypedArrayMap(android.util.ArrayMap<java.lang.String,T>,%20int)` at the current dataPosition(). The list *must* have previously been written via `https://developer.android.com/reference/android/os/Parcel#writeTypedArrayMap(android.util.ArrayMap<java.lang.String,T>,%20int)` with the same object type.

<br />

| Parameters ||
|---|---|
| `creator` | `Creator`: The creator to use when for instantiation. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/ArrayMap<https://developer.android.com/reference/java/lang/String, T>` | A newly created `https://developer.android.com/reference/android/util/ArrayMap` containing objects with the same data as those that were previously written. This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeTypedArrayMap(android.util.ArrayMap<java.lang.String,T>,%20int)`

### createTypedSparseArray

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SparseArray<T> createTypedSparseArray (Creator<T> creator)
```

Read into a new `https://developer.android.com/reference/android/util/SparseArray` items containing a particular object type that were written with `https://developer.android.com/reference/android/os/Parcel#writeTypedSparseArray(android.util.SparseArray<T>,%20int)` at the current dataPosition(). The list *must* have previously been written via `https://developer.android.com/reference/android/os/Parcel#writeTypedSparseArray(android.util.SparseArray<T>,%20int)` with the same object type.

<br />

| Parameters ||
|---|---|
| `creator` | `Creator`: The creator to use when for instantiation. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/SparseArray<T>` | A newly created `https://developer.android.com/reference/android/util/SparseArray` containing objects with the same data as those that were previously written. This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeTypedSparseArray(android.util.SparseArray<T>,%20int)`

### dataAvail

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int dataAvail ()
```

Returns the amount of data remaining to be read from the parcel. That is, `https://developer.android.com/reference/android/os/Parcel#dataSize()`-`https://developer.android.com/reference/android/os/Parcel#dataPosition()`.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### dataCapacity

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int dataCapacity ()
```

Returns the total amount of space in the parcel. This is always \>= `https://developer.android.com/reference/android/os/Parcel#dataSize()`. The difference between it and dataSize() is the amount of room left until the parcel needs to re-allocate its data buffer.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### dataPosition

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int dataPosition ()
```

Returns the current position in the parcel data. Never more than `https://developer.android.com/reference/android/os/Parcel#dataSize()`.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### dataSize

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int dataSize ()
```

Returns the total amount of data contained in the parcel.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### enforceInterface

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void enforceInterface (String interfaceName)
```

Read the header written by writeInterfaceToken and verify it matches the interface name in question. If the wrong interface type is present, `https://developer.android.com/reference/java/lang/SecurityException` is thrown. When used over binder, this exception should propagate to the caller.

<br />

| Parameters ||
|---|---|
| `interfaceName` | `String`: This value cannot be `null`. <br /> |

### enforceNoDataAvail

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void enforceNoDataAvail ()
```

Verify there are no bytes left to be read on the Parcel.

<br />

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | If the current position hasn't reached the end of the Parcel. When used over binder, this exception should propagate to the caller. |

### hasFileDescriptors

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean hasFileDescriptors ()
```

Report whether the parcel contains any marshalled file descriptors. WARNING: Parcelable definitions change over time. Unless you define a Parcelable yourself OR the Parcelable explicitly guarantees that it would never include such objects, you should not expect the return value to stay the same, and your code should continue to work even if the return value changes.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### hasFileDescriptors

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean hasFileDescriptors (int offset, 
                int length)
```

Report whether the parcel contains any marshalled file descriptors in the range defined by `offset` and `length`. WARNING: Parcelable definitions change over time. Unless you define a Parcelable yourself OR the Parcelable explicitly guarantees that it would never include such objects, you should not expect the return value to stay the same, and your code should continue to work even if the return value changes.

<br />

| Parameters ||
|---|---|
| `offset` | `int`: The offset from which the range starts. Should be between 0 and `https://developer.android.com/reference/android/os/Parcel#dataSize()`. <br /> |
| `length` | `int`: The length of the range. Should be between 0 and `https://developer.android.com/reference/android/os/Parcel#dataSize()` - `offset`. <br /> |

| Returns ||
|---|---|
| `boolean` | whether there are file descriptors or not. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the parameters are out of the permitted ranges. |

### marshall

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void marshall (ByteBuffer buffer)
```

Writes the raw bytes of the parcel to a buffer.

The data you retrieve here **must not** be placed in any kind of persistent storage (on local disk, across a network, etc). For that, you should use standard serialization or another kind of general serialization mechanism. The Parcel marshalled representation is highly optimized for local IPC, and as such does not attempt to maintain compatibility with data created in different versions of the platform.

<br />

| Parameters ||
|---|---|
| `buffer` | `ByteBuffer`: The ByteBuffer to write the data to. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/nio/BufferOverflowException` | if the buffer is too small. |
| `https://developer.android.com/reference/java/nio/ReadOnlyBufferException` | if the buffer is read-only. |

### marshall

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public byte[] marshall ()
```

Returns the raw bytes of the parcel.

The data you retrieve here **must not** be placed in any kind of persistent storage (on local disk, across a network, etc). For that, you should use standard serialization or another kind of general serialization mechanism. The Parcel marshalled representation is highly optimized for local IPC, and as such does not attempt to maintain compatibility with data created in different versions of the platform.

<br />

| Returns ||
|---|---|
| `byte[]` | <br /> |

### obtain

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Parcel obtain ()
```

Retrieve a new Parcel object from the pool.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Parcel` | This value cannot be `null`. <br /> |

### obtain

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Parcel obtain (IBinder binder)
```

Retrieve a new Parcel object from the pool for use with a specific binder. Associate this parcel with a binder object. This marks the parcel as being prepared for a transaction on this specific binder object. Based on this, the format of the wire binder protocol may change. For future compatibility, it is recommended to use this for all Parcels.

<br />

| Parameters ||
|---|---|
| `binder` | `IBinder`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Parcel` | This value cannot be `null`. <br /> |

### readArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Object[] readArray (ClassLoader loader)
```

<br />

**This method was deprecated in API level 33.**   

Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readArray(java.lang.ClassLoader,%20java.lang.Class<T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Also consider changing the format to use `https://developer.android.com/reference/android/os/Parcel#createTypedArray(android.os.Parcelable.Creator<T>)` if possible (eg. if the items' class is final) since this is also more performant. Note that changing to the latter also requires changing the writes.

Read and return a new Object array from the parcel at the current dataPosition(). Returns null if the previously written array was null. The given class loader will be used to load any enclosed Parcelables.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/Object` | <br /> |

### readArray

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public T[] readArray (ClassLoader loader, 
                Class<T> clazz)
```

Same as `https://developer.android.com/reference/android/os/Parcel#readArray(java.lang.ClassLoader)` but accepts `clazz` parameter as the type required for each item.

**Warning:** if the list contains items implementing the `https://developer.android.com/reference/android/os/Parcelable` interface, the class that implements `https://developer.android.com/reference/android/os/Parcelable` has to be the immediately enclosing class of the runtime type of its CREATOR field (that is, `https://developer.android.com/reference/java/lang/Class#getEnclosingClass()` has to return the parcelable implementing class), otherwise this method might throw an exception. If the Parcelable class does not enclose the CREATOR, use the deprecated `https://developer.android.com/reference/android/os/Parcel#readArray(java.lang.ClassLoader)` instead.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |
| `clazz` | `Class`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `T[]` | This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | Throws BadParcelableException if the item to be deserialized is not an instance of that class or any of its children classes or there was an error trying to instantiate an element. |

### readArrayList

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ArrayList<T> readArrayList (ClassLoader loader, 
                Class<? extends T> clazz)
```

Same as `https://developer.android.com/reference/android/os/Parcel#readArrayList(java.lang.ClassLoader)` but accepts `clazz` parameter as the type required for each item.

**Warning:** if the list contains items implementing the `https://developer.android.com/reference/android/os/Parcelable` interface, the class that implements `https://developer.android.com/reference/android/os/Parcelable` has to be the immediately enclosing class of the runtime type of its CREATOR field (that is, `https://developer.android.com/reference/java/lang/Class#getEnclosingClass()` has to return the parcelable implementing class), otherwise this method might throw an exception. If the Parcelable class does not enclose the CREATOR, use the deprecated `https://developer.android.com/reference/android/os/Parcel#readArrayList(java.lang.ClassLoader)` instead.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |
| `clazz` | `Class`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/ArrayList<T>` | This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | Throws BadParcelableException if the item to be deserialized is not an instance of that class or any of its children classes or there was an error trying to instantiate an element. |

### readArrayList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ArrayList<E> readArrayList (ClassLoader loader)
```

<br />

**This method was deprecated in API level 33.**   

Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readArrayList(java.lang.ClassLoader,%20java.lang.Class<?%20extends%20T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Also consider changing the format to use `https://developer.android.com/reference/android/os/Parcel#createTypedArrayList(android.os.Parcelable.Creator<T>)` if possible (eg. if the items' class is final) since this is also more performant. Note that changing to the latter also requires changing the writes.

Read and return a new ArrayList object from the parcel at the current dataPosition(). Returns null if the previously written list object was null. The given class loader will be used to load any enclosed Parcelables.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/ArrayList<E>` | <br /> |

### readBinderArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readBinderArray (IBinder[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `IBinder`: This value cannot be `null`. <br /> |

### readBinderList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readBinderList (List<IBinder> list)
```

Read into the given List items IBinder objects that were written with `https://developer.android.com/reference/android/os/Parcel#writeBinderList(java.util.List<android.os.IBinder>)` at the current dataPosition().

<br />

| Parameters ||
|---|---|
| `list` | `List`: This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeBinderList(java.util.List<android.os.IBinder>)`

### readBlob

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public byte[] readBlob ()
```

Read a blob of data from the parcel and return it as a byte array.

<br />

| Returns ||
|---|---|
| `byte[]` | This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeBlob(byte[],%20int,%20int)`

### readBoolean

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean readBoolean ()
```

Read a boolean value from the parcel at the current dataPosition().

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### readBooleanArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readBooleanArray (boolean[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `boolean`: This value cannot be `null`. <br /> |

### readBundle

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Bundle readBundle ()
```

Read and return a new Bundle object from the parcel at the current dataPosition(). Returns null if the previously written Bundle object was null.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Bundle` | <br /> |

### readBundle

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Bundle readBundle (ClassLoader loader)
```

Read and return a new Bundle object from the parcel at the current dataPosition(), using the given class loader to initialize the class loader of the Bundle for later retrieval of Parcelable objects. Returns null if the previously written Bundle object was null.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Bundle` | <br /> |

### readByte

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public byte readByte ()
```

Read a byte value from the parcel at the current dataPosition().

<br />

| Returns ||
|---|---|
| `byte` | <br /> |

### readByteArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readByteArray (byte[] val)
```

Read a byte\[\] object from the parcel and copy it into the given byte array.

<br />

| Parameters ||
|---|---|
| `val` | `byte`: This value cannot be `null`. <br /> |

### readCharArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readCharArray (char[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `char`: This value cannot be `null`. <br /> |

### readDouble

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public double readDouble ()
```

Read a double precision floating point value from the parcel at the current dataPosition().

<br />

| Returns ||
|---|---|
| `double` | <br /> |

### readDoubleArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readDoubleArray (double[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `double`: This value cannot be `null`. <br /> |

### readException

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readException ()
```

Special function for reading an exception result from the header of a parcel, to be used after receiving the result of a transaction. This will throw the exception for you if it had been written to the Parcel, otherwise return and let you read the normal result data from the Parcel.

<br />

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeException(java.lang.Exception)`
- `https://developer.android.com/reference/android/os/Parcel#writeNoException()`

### readException

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readException (int code, 
                String msg)
```

Throw an exception with the given message. Not intended for use outside the Parcel class.

<br />

| Parameters ||
|---|---|
| `code` | `int`: Used to determine which exception class to throw. <br /> |
| `msg` | `String`: The exception message. <br /> |

### readFileDescriptor

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ParcelFileDescriptor readFileDescriptor ()
```

Read a FileDescriptor from the parcel at the current dataPosition().

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/ParcelFileDescriptor` | <br /> |

### readFixedArray

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readFixedArray (T val, 
                Creator<S> c)
```

Read a new multi-dimensional array of typed parcelables from a parcel. If you want to read IInterface values, use `https://developer.android.com/reference/android/os/Parcel#readFixedArray(T,%20java.util.function.Function<android.os.IBinder,S>)`. For values of other types, use `https://developer.android.com/reference/android/os/Parcel#readFixedArray(T)`.

<br />

| Parameters ||
|---|---|
| `val` | `T`: the destination array to hold the read values. This value cannot be `null`. <br /> |
| `c` | `Creator`: This value cannot be `null`. <br /> |

### readFixedArray

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readFixedArray (T val, 
                Function<IBinder, S> asInterface)
```

Read a new multi-dimensional array of typed interfaces from a parcel. If you want to read Parcelable values, use `https://developer.android.com/reference/android/os/Parcel#readFixedArray(T,%20android.os.Parcelable.Creator<S>)`. For values of other types, use `https://developer.android.com/reference/android/os/Parcel#readFixedArray(T)`.

<br />

| Parameters ||
|---|---|
| `val` | `T`: the destination array to hold the read values. This value cannot be `null`. <br /> |
| `asInterface` | `Function`: This value cannot be `null`. <br /> |

### readFixedArray

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readFixedArray (T val)
```

Read a new multi-dimensional array from a parcel. If you want to read Parcelable or IInterface values, use `https://developer.android.com/reference/android/os/Parcel#readFixedArray(T,%20android.os.Parcelable.Creator<S>)` or `https://developer.android.com/reference/android/os/Parcel#readFixedArray(T,%20java.util.function.Function<android.os.IBinder,S>)`.

<br />

| Parameters ||
|---|---|
| `val` | `T`: the destination array to hold the read values. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeTypedArray(T[],%20int)`
- `https://developer.android.com/reference/android/os/Parcel#readBooleanArray(boolean[])`
- `https://developer.android.com/reference/android/os/Parcel#readByteArray(byte[])`
- `https://developer.android.com/reference/android/os/Parcel#readCharArray(char[])`
- `https://developer.android.com/reference/android/os/Parcel#readIntArray(int[])`
- `https://developer.android.com/reference/android/os/Parcel#readLongArray(long[])`
- `https://developer.android.com/reference/android/os/Parcel#readFloatArray(float[])`
- `https://developer.android.com/reference/android/os/Parcel#readDoubleArray(double[])`
- `https://developer.android.com/reference/android/os/Parcel#readBinderArray(android.os.IBinder[])`
- `https://developer.android.com/reference/android/os/Parcel#readInterfaceArray(T[],%20java.util.function.Function<android.os.IBinder,T>)`
- `https://developer.android.com/reference/android/os/Parcel#readTypedArray(T[],%20android.os.Parcelable.Creator<T>)`

### readFloat

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float readFloat ()
```

Read a floating point value from the parcel at the current dataPosition().

<br />

| Returns ||
|---|---|
| `float` | <br /> |

### readFloatArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readFloatArray (float[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `float`: This value cannot be `null`. <br /> |

### readHashMap

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public HashMap<K, V> readHashMap (ClassLoader loader)
```

<br />

**This method was deprecated in API level 33.**   

Consider using `https://developer.android.com/reference/android/os/Parcel#readBundle(java.lang.ClassLoader)` as stated above, in case this method is still preferred use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readHashMap(java.lang.ClassLoader,%20java.lang.Class<?%20extends%20K>,%20java.lang.Class<?%20extends%20V>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`.

Please use `https://developer.android.com/reference/android/os/Parcel#readBundle(java.lang.ClassLoader)` instead (whose data must have been written with `https://developer.android.com/reference/android/os/Parcel#writeBundle(android.os.Bundle)`. Read and return a new HashMap object from the parcel at the current dataPosition(), using the given class loader to load any enclosed Parcelables. Returns null if the previously written map object was null.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/HashMap<K, V>` | <br /> |

### readHashMap

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public HashMap<K, V> readHashMap (ClassLoader loader, 
                Class<? extends K> clazzKey, 
                Class<? extends V> clazzValue)
```

Same as `https://developer.android.com/reference/android/os/Parcel#readHashMap(java.lang.ClassLoader)` but accepts `clazzKey` and `clazzValue` parameter as the types required for each key and value pair.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |
| `clazzKey` | `Class`: This value cannot be `null`. <br /> |
| `clazzValue` | `Class`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/HashMap<K, V>` | This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | if the item to be deserialized is not an instance of that class or any of its children class |

### readInt

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int readInt ()
```

Read an integer value from the parcel at the current dataPosition().

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### readIntArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readIntArray (int[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `int`: This value cannot be `null`. <br /> |

### readInterfaceArray

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readInterfaceArray (T[] val, 
                Function<IBinder, T> asInterface)
```

Read an array of T (IInterface) from a parcel.

<br />

| Parameters ||
|---|---|
| `val` | `T`: This value cannot be `null`. <br /> |
| `asInterface` | `Function`: a function to convert IBinder object into T (IInterface). This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | Throws BadParcelableException if the length of \`val\` mismatches the number of items in the parcel. |

### readInterfaceList

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readInterfaceList (List<T> list, 
                Function<IBinder, T> asInterface)
```

Read into the given List items IInterface objects that were written with `https://developer.android.com/reference/android/os/Parcel#writeInterfaceList(java.util.List<T>)` at the current dataPosition().

<br />

| Parameters ||
|---|---|
| `list` | `List`: This value cannot be `null`. <br /> |
| `asInterface` | `Function`: This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeInterfaceList(java.util.List<T>)`

### readList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readList (List<E> outVal, 
                ClassLoader loader)
```

<br />

**This method was deprecated in API level 33.**   

Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readList(java.util.List<?%20super%20T>,%20java.lang.ClassLoader,%20java.lang.Class<T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Also consider changing the format to use `https://developer.android.com/reference/android/os/Parcel#readTypedList(java.util.List<T>,%20android.os.Parcelable.Creator<T>)` if possible (eg. if the items' class is final) since this is also more performant. Note that changing to the latter also requires changing the writes.

Read into an existing List object from the parcel at the current dataPosition(), using the given class loader to load any enclosed Parcelables. If it is null, the default class loader is used.

<br />

| Parameters ||
|---|---|
| `outVal` | `List`: This value cannot be `null`. <br /> |
| `loader` | `ClassLoader`: This value may be `null`. <br /> |

### readList

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readList (List<? super T> outVal, 
                ClassLoader loader, 
                Class<T> clazz)
```

Same as `https://developer.android.com/reference/android/os/Parcel#readList(java.util.List,%20java.lang.ClassLoader)` but accepts `clazz` parameter as the type required for each item.

**Warning:** if the list contains items implementing the `https://developer.android.com/reference/android/os/Parcelable` interface, the class that implements `https://developer.android.com/reference/android/os/Parcelable` has to be the immediately enclosing class of the runtime type of its CREATOR field (that is, `https://developer.android.com/reference/java/lang/Class#getEnclosingClass()` has to return the parcelable implementing class), otherwise this method might throw an exception. If the Parcelable class does not enclose the CREATOR, use the deprecated `https://developer.android.com/reference/android/os/Parcel#readList(java.util.List,%20java.lang.ClassLoader)` instead.

<br />

| Parameters ||
|---|---|
| `outVal` | `List`: This value cannot be `null`. <br /> |
| `loader` | `ClassLoader`: This value may be `null`. <br /> |
| `clazz` | `Class`: This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | Throws BadParcelableException if the item to be deserialized is not an instance of that class or any of its children classes or there was an error trying to instantiate an element. |

### readLong

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long readLong ()
```

Read a long integer value from the parcel at the current dataPosition().

<br />

| Returns ||
|---|---|
| `long` | <br /> |

### readLongArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readLongArray (long[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `long`: This value cannot be `null`. <br /> |

### readMap

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readMap (Map<K, V> outVal, 
                ClassLoader loader)
```

<br />

**This method was deprecated in API level 33.**   

Consider using `https://developer.android.com/reference/android/os/Parcel#readBundle(java.lang.ClassLoader)` as stated above, in case this method is still preferred use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readMap(java.util.Map<?%20super%20K,?%20super%20V>,%20java.lang.ClassLoader,%20java.lang.Class<K>,%20java.lang.Class<V>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`.

Please use `https://developer.android.com/reference/android/os/Parcel#readBundle(java.lang.ClassLoader)` instead (whose data must have been written with `https://developer.android.com/reference/android/os/Parcel#writeBundle(android.os.Bundle)`. Read into an existing Map object from the parcel at the current dataPosition().

<br />

| Parameters ||
|---|---|
| `outVal` | `Map`: This value cannot be `null`. <br /> |
| `loader` | `ClassLoader`: This value may be `null`. <br /> |

### readMap

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readMap (Map<? super K, ? super V> outVal, 
                ClassLoader loader, 
                Class<K> clazzKey, 
                Class<V> clazzValue)
```

Same as `https://developer.android.com/reference/android/os/Parcel#readMap(java.util.Map,%20java.lang.ClassLoader)` but accepts `clazzKey` and `clazzValue` parameter as the types required for each key and value pair.

<br />

| Parameters ||
|---|---|
| `outVal` | `Map`: This value cannot be `null`. <br /> |
| `loader` | `ClassLoader`: This value may be `null`. <br /> |
| `clazzKey` | `Class`: This value cannot be `null`. <br /> |
| `clazzValue` | `Class`: This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | If the item to be deserialized is not an instance of that class or any of its children class |

### readParcelable

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public T readParcelable (ClassLoader loader)
```

<br />

**This method was deprecated in API level 33.**   

Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readParcelable(java.lang.ClassLoader,%20java.lang.Class<T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Also consider changing the format to use `https://developer.android.com/reference/android/os/Parcelable.Creator#createFromParcel(android.os.Parcel)` if possible since this is also more performant. Note that changing to the latter also requires changing the writes.

Read and return a new Parcelable from the parcel. The given class loader will be used to load any enclosed Parcelables. If it is null, the default class loader will be used.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: A ClassLoader from which to instantiate the Parcelable object, or null for the default class loader. <br /> |

| Returns ||
|---|---|
| `T` | Returns the newly created Parcelable, or null if a null object has been written. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | Throws BadParcelableException if there was an error trying to instantiate the Parcelable. |

### readParcelable

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public T readParcelable (ClassLoader loader, 
                Class<T> clazz)
```

Same as `https://developer.android.com/reference/android/os/Parcel#readParcelable(java.lang.ClassLoader)` but accepts `clazz` parameter as the type required for each item.

**Warning:** the class that implements `https://developer.android.com/reference/android/os/Parcelable` has to be the immediately enclosing class of the runtime type of its CREATOR field (that is, `https://developer.android.com/reference/java/lang/Class#getEnclosingClass()` has to return the parcelable implementing class), otherwise this method might throw an exception. If the Parcelable class does not enclose the CREATOR, use the deprecated `https://developer.android.com/reference/android/os/Parcel#readParcelable(java.lang.ClassLoader)` instead.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |
| `clazz` | `Class`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `T` | This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | Throws BadParcelableException if the item to be deserialized is not an instance of that class or any of its children classes or there was an error trying to instantiate an element. |

### readParcelableArray

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public T[] readParcelableArray (ClassLoader loader, 
                Class<T> clazz)
```

Same as `https://developer.android.com/reference/android/os/Parcel#readParcelableArray(java.lang.ClassLoader)` but accepts `clazz` parameter as the type required for each item.

**Warning:** the class that implements `https://developer.android.com/reference/android/os/Parcelable` has to be the immediately enclosing class of the runtime type of its CREATOR field (that is, `https://developer.android.com/reference/java/lang/Class#getEnclosingClass()` has to return the parcelable implementing class), otherwise this method might throw an exception. If the Parcelable class does not enclose the CREATOR, use the deprecated `https://developer.android.com/reference/android/os/Parcel#readParcelableArray(java.lang.ClassLoader)` instead.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |
| `clazz` | `Class`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `T[]` | This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | Throws BadParcelableException if the item to be deserialized is not an instance of that class or any of its children classes or there was an error trying to instantiate an element. |

### readParcelableArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Parcelable[] readParcelableArray (ClassLoader loader)
```

<br />

**This method was deprecated in API level 33.**   

Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readParcelableArray(java.lang.ClassLoader,%20java.lang.Class<T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Also consider changing the format to use `https://developer.android.com/reference/android/os/Parcel#createTypedArray(android.os.Parcelable.Creator<T>)` if possible (eg. if the items' class is final) since this is also more performant. Note that changing to the latter also requires changing the writes.

Read and return a new Parcelable array from the parcel. The given class loader will be used to load any enclosed Parcelables.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Parcelable` | the Parcelable array, or null if the array is null <br /> |

### readParcelableCreator

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Creator<?> readParcelableCreator (ClassLoader loader)
```

<br />

**This method was deprecated in API level 33.**   

Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readParcelableCreator(java.lang.ClassLoader,%20java.lang.Class<T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`.

Read and return a Parcelable.Creator from the parcel. The given class loader will be used to load the `https://developer.android.com/reference/android/os/Parcelable.Creator`. If it is null, the default class loader will be used.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: A ClassLoader from which to instantiate the `https://developer.android.com/reference/android/os/Parcelable.Creator` object, or null for the default class loader. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Parcelable.Creator<?>` | the previously written `https://developer.android.com/reference/android/os/Parcelable.Creator`, or null if a null Creator was written. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | Throws BadParcelableException if there was an error trying to read the `https://developer.android.com/reference/android/os/Parcelable.Creator`. |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeParcelableCreator(android.os.Parcelable)`

### readParcelableCreator

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Creator<T> readParcelableCreator (ClassLoader loader, 
                Class<T> clazz)
```

Same as `https://developer.android.com/reference/android/os/Parcel#readParcelableCreator(java.lang.ClassLoader)` but accepts `clazz` parameter as the required type.

**Warning:** the class that implements `https://developer.android.com/reference/android/os/Parcelable` has to be the immediately enclosing class of the runtime type of its CREATOR field (that is, `https://developer.android.com/reference/java/lang/Class#getEnclosingClass()` has to return the parcelable implementing class), otherwise this method might throw an exception. If the Parcelable class does not enclose the CREATOR, use the deprecated `https://developer.android.com/reference/android/os/Parcel#readParcelableCreator(java.lang.ClassLoader)` instead.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |
| `clazz` | `Class`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Parcelable.Creator<T>` | This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | Throws BadParcelableException if the item to be deserialized is not an instance of that class or any of its children classes or there there was an error trying to read the `https://developer.android.com/reference/android/os/Parcelable.Creator`. |

### readParcelableList

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<T> readParcelableList (List<T> list, 
                ClassLoader cl, 
                Class<? extends T> clazz)
```

Same as `https://developer.android.com/reference/android/os/Parcel#readParcelableList(java.util.List<T>,%20java.lang.ClassLoader)` but accepts `clazz` parameter as the type required for each item.

**Warning:** if the list contains items implementing the `https://developer.android.com/reference/android/os/Parcelable` interface, the class that implements `https://developer.android.com/reference/android/os/Parcelable` has to be the immediately enclosing class of the runtime type of its CREATOR field (that is, `https://developer.android.com/reference/java/lang/Class#getEnclosingClass()` has to return the parcelable implementing class), otherwise this method might throw an exception. If the Parcelable class does not enclose the CREATOR, use the deprecated `https://developer.android.com/reference/android/os/Parcel#readParcelableList(java.util.List<T>,%20java.lang.ClassLoader)` instead.

<br />

| Parameters ||
|---|---|
| `list` | `List`: This value cannot be `null`. <br /> |
| `cl` | `ClassLoader`: This value may be `null`. <br /> |
| `clazz` | `Class`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<T>` | This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | Throws BadParcelableException if the item to be deserialized is not an instance of that class or any of its children classes or there was an error trying to instantiate an element. |

### readParcelableList

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<T> readParcelableList (List<T> list, 
                ClassLoader cl)
```

<br />

**This method was deprecated in API level 33.**   

Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readParcelableList(java.util.List<T>,%20java.lang.ClassLoader,%20java.lang.Class<?%20extends%20T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Also consider changing the format to use `https://developer.android.com/reference/android/os/Parcel#readTypedList(java.util.List<T>,%20android.os.Parcelable.Creator<T>)` if possible (eg. if the items' class is final) since this is also more performant. Note that changing to the latter also requires changing the writes.

Read the list of `Parcelable` objects at the current data position into the given `list`. The contents of the `list` are replaced. If the serialized list was `null`, `list` is cleared.

<br />

| Parameters ||
|---|---|
| `list` | `List`: This value cannot be `null`. <br /> |
| `cl` | `ClassLoader`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<T>` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeParcelableList(java.util.List<T>,%20int)`

### readPersistableBundle

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PersistableBundle readPersistableBundle ()
```

Read and return a new Bundle object from the parcel at the current dataPosition(). Returns null if the previously written Bundle object was null.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/PersistableBundle` | <br /> |

### readPersistableBundle

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PersistableBundle readPersistableBundle (ClassLoader loader)
```

Read and return a new Bundle object from the parcel at the current dataPosition(), using the given class loader to initialize the class loader of the Bundle for later retrieval of Parcelable objects. Returns null if the previously written Bundle object was null.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/PersistableBundle` | <br /> |

### readSerializable

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Serializable readSerializable ()
```

<br />

**This method was deprecated in API level 33.**   

Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readSerializable(java.lang.ClassLoader,%20java.lang.Class<T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`.

Read and return a new Serializable object from the parcel.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/Serializable` | the Serializable object, or null if the Serializable name wasn't found in the parcel. Unlike `https://developer.android.com/reference/android/os/Parcel#readSerializable(java.lang.ClassLoader,%20java.lang.Class<T>)`, it uses the nearest valid class loader up the execution stack to instantiate the Serializable object. <br /> |

### readSerializable

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public T readSerializable (ClassLoader loader, 
                Class<T> clazz)
```

Same as `https://developer.android.com/reference/android/os/Parcel#readSerializable()` but accepts `loader` and `clazz` parameters.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: A ClassLoader from which to instantiate the Serializable object, or null for the default class loader. <br /> |
| `clazz` | `Class`: The type of the object expected. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `T` | This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | Throws BadParcelableException if the item to be deserialized is not an instance of that class or any of its children class or there there was an error deserializing the object. |

### readSize

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Size readSize ()
```

Read a Size from the parcel at the current dataPosition().

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Size` | This value cannot be `null`. <br /> |

### readSizeF

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SizeF readSizeF ()
```

Read a SizeF from the parcel at the current dataPosition().

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/SizeF` | This value cannot be `null`. <br /> |

### readSparseArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SparseArray<T> readSparseArray (ClassLoader loader)
```

<br />

**This method was deprecated in API level 33.**   

Use the type-safer version `https://developer.android.com/reference/android/os/Parcel#readSparseArray(java.lang.ClassLoader,%20java.lang.Class<?%20extends%20T>)` starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Also consider changing the format to use `https://developer.android.com/reference/android/os/Parcel#createTypedSparseArray(android.os.Parcelable.Creator<T>)` if possible (eg. if the items' class is final) since this is also more performant. Note that changing to the latter also requires changing the writes.

Read and return a new SparseArray object from the parcel at the current dataPosition(). Returns null if the previously written list object was null. The given class loader will be used to load any enclosed Parcelables.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/SparseArray<T>` | <br /> |

### readSparseArray

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SparseArray<T> readSparseArray (ClassLoader loader, 
                Class<? extends T> clazz)
```

Same as `https://developer.android.com/reference/android/os/Parcel#readSparseArray(java.lang.ClassLoader)` but accepts `clazz` parameter as the type required for each item.

**Warning:** if the list contains items implementing the `https://developer.android.com/reference/android/os/Parcelable` interface, the class that implements `https://developer.android.com/reference/android/os/Parcelable` has to be the immediately enclosing class of the runtime type of its CREATOR field (that is, `https://developer.android.com/reference/java/lang/Class#getEnclosingClass()` has to return the parcelable implementing class), otherwise this method might throw an exception. If the Parcelable class does not enclose the CREATOR, use the deprecated `https://developer.android.com/reference/android/os/Parcel#readSparseArray(java.lang.ClassLoader)` instead.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |
| `clazz` | `Class`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/SparseArray<T>` | This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | Throws BadParcelableException if the item to be deserialized is not an instance of that class or any of its children classes or there was an error trying to instantiate an element. |

### readSparseBooleanArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SparseBooleanArray readSparseBooleanArray ()
```

Read and return a new SparseBooleanArray object from the parcel at the current dataPosition(). Returns null if the previously written list object was null.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/SparseBooleanArray` | <br /> |

### readString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String readString ()
```

Read a string value from the parcel at the current dataPosition().

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value may be `null`. <br /> |

### readStringArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readStringArray (String[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `String`: This value cannot be `null`. <br /> |

### readStringList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readStringList (List<String> list)
```

Read into the given List items String objects that were written with `https://developer.android.com/reference/android/os/Parcel#writeStringList(java.util.List<java.lang.String>)` at the current dataPosition().

<br />

| Parameters ||
|---|---|
| `list` | `List`: This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeStringList(java.util.List<java.lang.String>)`

### readStrongBinder

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public IBinder readStrongBinder ()
```

Read an object from the parcel at the current dataPosition().

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/IBinder` | <br /> |

### readTypedArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readTypedArray (T[] val, 
                Creator<T> c)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `T`: This value cannot be `null`. <br /> |
| `c` | `Creator`: This value cannot be `null`. <br /> |

### readTypedList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void readTypedList (List<T> list, 
                Creator<T> c)
```

Read into the given List items containing a particular object type that were written with `https://developer.android.com/reference/android/os/Parcel#writeTypedList(java.util.List<T>)` at the current dataPosition(). The list *must* have previously been written via `https://developer.android.com/reference/android/os/Parcel#writeTypedList(java.util.List<T>)` with the same object type.

<br />

| Parameters ||
|---|---|
| `list` | `List`: This value cannot be `null`. <br /> |
| `c` | `Creator`: This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeTypedList(java.util.List<T>)`

### readTypedObject

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public T readTypedObject (Creator<T> c)
```

Read and return a typed Parcelable object from a parcel. Returns null if the previous written object was null. The object *must* have previous been written via `https://developer.android.com/reference/android/os/Parcel#writeTypedObject(T,%20int)` with the same object type.

<br />

| Parameters ||
|---|---|
| `c` | `Creator`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `T` | A newly created object of the type that was previously written. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeTypedObject(T,%20int)`

### readValue

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Object readValue (ClassLoader loader)
```

Read a typed object from a parcel. The given class loader will be used to load any enclosed Parcelables. If it is null, the default class loader will be used.

<br />

| Parameters ||
|---|---|
| `loader` | `ClassLoader`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/Object` | <br /> |

### recycle

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void recycle ()
```

Put a Parcel object back into the pool. You must not touch the object after this call.

<br />

### setDataCapacity

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setDataCapacity (int size)
```

Change the capacity (current available space) of the parcel.

<br />

| Parameters ||
|---|---|
| `size` | `int`: The new capacity of the parcel, in bytes. Can not be less than `https://developer.android.com/reference/android/os/Parcel#dataSize()` -- that is, you can not drop existing data with this method. <br /> |

### setDataPosition

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setDataPosition (int pos)
```

Move the current read/write position in the parcel.

<br />

| Parameters ||
|---|---|
| `pos` | `int`: New offset in the parcel; must be between 0 and `https://developer.android.com/reference/android/os/Parcel#dataSize()`. <br /> |

### setDataSize

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setDataSize (int size)
```

Change the amount of data in the parcel. Can be either smaller or larger than the current size. If larger than the current capacity, more memory will be allocated.

<br />

| Parameters ||
|---|---|
| `size` | `int`: The new number of bytes in the Parcel. <br /> |

### setPropagateAllowBlocking

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setPropagateAllowBlocking ()
```

This method is used by the AIDL compiler for system components. Not intended to be used by non-system apps.

<br />

### unmarshall

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void unmarshall (byte[] data, 
                int offset, 
                int length)
```

Fills the raw bytes of this Parcel with the supplied data.

<br />

| Parameters ||
|---|---|
| `data` | `byte`: This value cannot be `null`. <br /> |
| `offset` | `int` <br /> |
| `length` | `int` <br /> |

### unmarshall

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void unmarshall (ByteBuffer buffer)
```

Fills the raw bytes of this Parcel with data from the supplied buffer.

<br />

| Parameters ||
|---|---|
| `buffer` | `ByteBuffer`: will read buffer.remaining() bytes from the buffer. This value cannot be `null`. <br /> |

### writeArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeArray (Object[] val)
```

Flatten an Object array into the parcel at the current dataPosition(), growing dataCapacity() if needed. The array values are written using `https://developer.android.com/reference/android/os/Parcel#writeValue(java.lang.Object)` and must follow the specification there.

<br />

| Parameters ||
|---|---|
| `val` | `Object`: This value may be `null`. <br /> |

### writeBinderArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeBinderArray (IBinder[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `IBinder`: This value may be `null`. <br /> |

### writeBinderList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeBinderList (List<IBinder> val)
```

Flatten a List containing IBinder objects into the parcel, at the current dataPosition() and growing dataCapacity() if needed. They can later be retrieved with `https://developer.android.com/reference/android/os/Parcel#createBinderArrayList()` or `https://developer.android.com/reference/android/os/Parcel#readBinderList(java.util.List<android.os.IBinder>)`.

<br />

| Parameters ||
|---|---|
| `val` | `List`: The list of strings to be written. This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#createBinderArrayList()`
- `https://developer.android.com/reference/android/os/Parcel#readBinderList(java.util.List<android.os.IBinder>)`

### writeBlob

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeBlob (byte[] b)
```

Write a blob of data into the parcel at the current `https://developer.android.com/reference/android/os/Parcel#dataPosition()`, growing `https://developer.android.com/reference/android/os/Parcel#dataCapacity()` if needed.

If the blob is small, then it is stored in-place, otherwise it is transferred by way of an anonymous shared memory region. If you prefer send in-place, please use `https://developer.android.com/reference/android/os/Parcel#writeByteArray(byte[])`.

<br />

| Parameters ||
|---|---|
| `b` | `byte`: Bytes to place into the parcel. This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#readBlob()`

### writeBlob

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeBlob (byte[] b, 
                int offset, 
                int len)
```

Write a blob of data into the parcel at the current `https://developer.android.com/reference/android/os/Parcel#dataPosition()`, growing `https://developer.android.com/reference/android/os/Parcel#dataCapacity()` if needed.

If the blob is small, then it is stored in-place, otherwise it is transferred by way of an anonymous shared memory region. If you prefer send in-place, please use `https://developer.android.com/reference/android/os/Parcel#writeByteArray(byte[],%20int,%20int)`.

<br />

| Parameters ||
|---|---|
| `b` | `byte`: Bytes to place into the parcel. This value may be `null`. <br /> |
| `offset` | `int`: Index of first byte to be written. <br /> |
| `len` | `int`: Number of bytes to write. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#readBlob()`

### writeBoolean

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeBoolean (boolean val)
```

Write a boolean value into the parcel at the current dataPosition(), growing dataCapacity() if needed.

Note: This method currently delegates to writeInt with a value of 1 or 0 for true or false, respectively, but may change in the future.

<br />

| Parameters ||
|---|---|
| `val` | `boolean` <br /> |

### writeBooleanArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeBooleanArray (boolean[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `boolean`: This value may be `null`. <br /> |

### writeBundle

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeBundle (Bundle val)
```

Flatten a Bundle into the parcel at the current dataPosition(), growing dataCapacity() if needed.

<br />

| Parameters ||
|---|---|
| `val` | `Bundle`: This value may be `null`. <br /> |

### writeByte

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeByte (byte val)
```

Write a byte value into the parcel at the current dataPosition(), growing dataCapacity() if needed.

Note: This method currently delegates to writeInt but may change in the future.

<br />

| Parameters ||
|---|---|
| `val` | `byte` <br /> |

### writeByteArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeByteArray (byte[] b)
```

Write a byte array into the parcel at the current `https://developer.android.com/reference/android/os/Parcel#dataPosition()`, growing `https://developer.android.com/reference/android/os/Parcel#dataCapacity()` if needed.

<br />

| Parameters ||
|---|---|
| `b` | `byte`: Bytes to place into the parcel. This value may be `null`. <br /> |

### writeByteArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeByteArray (byte[] b, 
                int offset, 
                int len)
```

Write a byte array into the parcel at the current `https://developer.android.com/reference/android/os/Parcel#dataPosition()`, growing `https://developer.android.com/reference/android/os/Parcel#dataCapacity()` if needed.

<br />

| Parameters ||
|---|---|
| `b` | `byte`: Bytes to place into the parcel. This value may be `null`. <br /> |
| `offset` | `int`: Index of first byte to be written. <br /> |
| `len` | `int`: Number of bytes to write. <br /> |

### writeCharArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeCharArray (char[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `char`: This value may be `null`. <br /> |

### writeDouble

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeDouble (double val)
```

Write a double precision floating point value into the parcel at the current dataPosition(), growing dataCapacity() if needed.

<br />

| Parameters ||
|---|---|
| `val` | `double` <br /> |

### writeDoubleArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeDoubleArray (double[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `double`: This value may be `null`. <br /> |

### writeException

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeException (Exception e)
```

Special function for writing an exception result at the header of a parcel, to be used when returning an exception from a transaction. Note that this currently only supports a few exception types; any other exception will be re-thrown by this function as a RuntimeException (to be caught by the system's last-resort exception handling when dispatching a transaction).

The supported exception types are:

- `https://developer.android.com/reference/android/os/BadParcelableException`
- `https://developer.android.com/reference/java/lang/IllegalArgumentException`
- `https://developer.android.com/reference/java/lang/IllegalStateException`
- `https://developer.android.com/reference/java/lang/NullPointerException`
- `https://developer.android.com/reference/java/lang/SecurityException`
- `https://developer.android.com/reference/java/lang/UnsupportedOperationException`
- `https://developer.android.com/reference/android/os/NetworkOnMainThreadException`

<br />

<br />

| Parameters ||
|---|---|
| `e` | `Exception`: The Exception to be written. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeNoException()`
- `https://developer.android.com/reference/android/os/Parcel#readException()`

### writeFileDescriptor

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeFileDescriptor (FileDescriptor val)
```

Write a FileDescriptor into the parcel at the current dataPosition(), growing dataCapacity() if needed.

The file descriptor will not be closed, which may result in file descriptor leaks when objects are returned from Binder calls. Use `https://developer.android.com/reference/android/os/ParcelFileDescriptor#writeToParcel(android.os.Parcel,%20int)` instead, which accepts contextual flags and will close the original file descriptor if `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` is set.

<br />

<br />

| Parameters ||
|---|---|
| `val` | `FileDescriptor`: This value cannot be `null`. <br /> |

### writeFixedArray

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeFixedArray (T val, 
                int parcelableFlags, 
                int... dimensions)
```

Flatten a homogeneous multi-dimensional array with fixed-size. This delegates to other APIs to write a one-dimensional array. Use `https://developer.android.com/reference/android/os/Parcel#readFixedArray(T)` or `https://developer.android.com/reference/android/os/Parcel#createFixedArray(java.lang.Class<T>,%20int[])` with the same dimensions to unmarshal.

<br />

| Parameters ||
|---|---|
| `val` | `T`: The array to be written. This value may be `null`. <br /> |
| `parcelableFlags` | `int`: Contextual flags as per `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`. Used only if val is an array of Parcelable objects. <br /> |
| `dimensions` | `int`: an array of int representing length of each dimension. The array should be sized with the exact size of dimensions. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/os/BadParcelableException` | If the array's component type is not supported or if its size doesn't match with the given dimensions. |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#readFixedArray(T)`
- `https://developer.android.com/reference/android/os/Parcel#createFixedArray(java.lang.Class<T>,%20android.os.Parcelable.Creator<S>,%20int[])`
- `https://developer.android.com/reference/android/os/Parcel#writeBooleanArray(boolean[])`
- `https://developer.android.com/reference/android/os/Parcel#writeByteArray(byte[])`
- `https://developer.android.com/reference/android/os/Parcel#writeCharArray(char[])`
- `https://developer.android.com/reference/android/os/Parcel#writeIntArray(int[])`
- `https://developer.android.com/reference/android/os/Parcel#writeLongArray(long[])`
- `https://developer.android.com/reference/android/os/Parcel#writeFloatArray(float[])`
- `https://developer.android.com/reference/android/os/Parcel#writeDoubleArray(double[])`
- `https://developer.android.com/reference/android/os/Parcel#writeBinderArray(android.os.IBinder[])`
- `https://developer.android.com/reference/android/os/Parcel#writeInterfaceArray(T[])`
- `https://developer.android.com/reference/android/os/Parcel#writeTypedArray(T[],%20int)`

### writeFloat

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeFloat (float val)
```

Write a floating point value into the parcel at the current dataPosition(), growing dataCapacity() if needed.

<br />

| Parameters ||
|---|---|
| `val` | `float` <br /> |

### writeFloatArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeFloatArray (float[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `float`: This value may be `null`. <br /> |

### writeInt

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeInt (int val)
```

Write an integer value into the parcel at the current dataPosition(), growing dataCapacity() if needed.

<br />

| Parameters ||
|---|---|
| `val` | `int` <br /> |

### writeIntArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeIntArray (int[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `int`: This value may be `null`. <br /> |

### writeInterfaceArray

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeInterfaceArray (T[] val)
```

Flatten a homogeneous array containing an IInterface type into the parcel, at the current dataPosition() and growing dataCapacity() if needed. The type of the objects in the array must be one that implements IInterface.

<br />

| Parameters ||
|---|---|
| `val` | `T`: The array of objects to be written. This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#createInterfaceArray(java.util.function.IntFunction<T[]>,%20java.util.function.Function<android.os.IBinder,T>)`
- `https://developer.android.com/reference/android/os/Parcel#readInterfaceArray(T[],%20java.util.function.Function<android.os.IBinder,T>)`
- `https://developer.android.com/reference/android/os/IInterface`

### writeInterfaceList

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeInterfaceList (List<T> val)
```

Flatten a `List` containing T (IInterface) objects into this parcel at the current position. They can later be retrieved with `https://developer.android.com/reference/android/os/Parcel#createInterfaceArrayList(java.util.function.Function<android.os.IBinder,T>)` or `https://developer.android.com/reference/android/os/Parcel#readInterfaceList(java.util.List<T>,%20java.util.function.Function<android.os.IBinder,T>)`.

<br />

| Parameters ||
|---|---|
| `val` | `List`: This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#createInterfaceArrayList(java.util.function.Function<android.os.IBinder,T>)`
- `https://developer.android.com/reference/android/os/Parcel#readInterfaceList(java.util.List<T>,%20java.util.function.Function<android.os.IBinder,T>)`

### writeInterfaceToken

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeInterfaceToken (String interfaceName)
```

Store or read an IBinder interface token in the parcel at the current `https://developer.android.com/reference/android/os/Parcel#dataPosition()`. This is used to validate that the marshalled transaction is intended for the target interface. This is typically written at the beginning of transactions as a header.

<br />

| Parameters ||
|---|---|
| `interfaceName` | `String`: This value cannot be `null`. <br /> |

### writeList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeList (List<E> val)
```

Flatten a List into the parcel at the current dataPosition(), growing dataCapacity() if needed. The List values are written using `https://developer.android.com/reference/android/os/Parcel#writeValue(java.lang.Object)` and must follow the specification there.

<br />

| Parameters ||
|---|---|
| `val` | `List`: This value may be `null`. <br /> |

### writeLong

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeLong (long val)
```

Write a long integer value into the parcel at the current dataPosition(), growing dataCapacity() if needed.

<br />

| Parameters ||
|---|---|
| `val` | `long` <br /> |

### writeLongArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeLongArray (long[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `long`: This value may be `null`. <br /> |

### writeMap

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeMap (Map<K, V> val)
```

Please use `https://developer.android.com/reference/android/os/Parcel#writeBundle(android.os.Bundle)` instead. Flattens a Map into the parcel at the current dataPosition(), growing dataCapacity() if needed. The Map keys must be String objects. The Map values are written using `https://developer.android.com/reference/android/os/Parcel#writeValue(java.lang.Object)` and must follow the specification there.

It is strongly recommended to use `https://developer.android.com/reference/android/os/Parcel#writeBundle(android.os.Bundle)` instead of this method, since the Bundle class provides a type-safe API that allows you to avoid mysterious type errors at the point of marshalling.

<br />

| Parameters ||
|---|---|
| `val` | `Map`: This value may be `null`. <br /> |

### writeNoException

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeNoException ()
```

Special function for writing information at the front of the Parcel indicating that no exception occurred.

<br />

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeException(java.lang.Exception)`
- `https://developer.android.com/reference/android/os/Parcel#readException()`

### writeParcelable

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeParcelable (Parcelable p, 
                int parcelableFlags)
```

Flatten the name of the class of the Parcelable and its contents into the parcel.

<br />

| Parameters ||
|---|---|
| `p` | `Parcelable`: The Parcelable object to be written. This value may be `null`. <br /> |
| `parcelableFlags` | `int`: Contextual flags as per `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`. <br /> |

### writeParcelableArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeParcelableArray (T[] value, 
                int parcelableFlags)
```

Write a heterogeneous array of Parcelable objects into the Parcel. Each object in the array is written along with its class name, so that the correct class can later be instantiated. As a result, this has significantly more overhead than `https://developer.android.com/reference/android/os/Parcel#writeTypedArray(T[],%20int)`, but will correctly handle an array containing more than one type of object.

<br />

| Parameters ||
|---|---|
| `value` | `T`: The array of objects to be written. This value may be `null`. <br /> |
| `parcelableFlags` | `int`: Contextual flags as per `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#writeTypedArray(T[],%20int)`

### writeParcelableCreator

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeParcelableCreator (Parcelable p)
```

Flatten the name of the class of the Parcelable into this Parcel.

<br />

| Parameters ||
|---|---|
| `p` | `Parcelable`: The Parcelable object to be written. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#readParcelableCreator(java.lang.ClassLoader)`

### writeParcelableList

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeParcelableList (List<T> val, 
                int flags)
```

Flatten a `List` containing arbitrary `Parcelable` objects into this parcel at the current position. They can later be retrieved using `https://developer.android.com/reference/android/os/Parcel#readParcelableList(java.util.List<T>,%20java.lang.ClassLoader)` if required.

<br />

| Parameters ||
|---|---|
| `val` | `List`: This value may be `null`. <br /> |
| `flags` | `int` <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#readParcelableList(java.util.List<T>,%20java.lang.ClassLoader)`

### writePersistableBundle

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writePersistableBundle (PersistableBundle val)
```

Flatten a PersistableBundle into the parcel at the current dataPosition(), growing dataCapacity() if needed.

<br />

| Parameters ||
|---|---|
| `val` | `PersistableBundle`: This value may be `null`. <br /> |

### writeSerializable

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeSerializable (Serializable s)
```

Write a generic serializable object in to a Parcel. It is strongly recommended that this method be avoided, since the serialization overhead is extremely large, and this approach will be much slower than using the other approaches to writing data in to a Parcel.

<br />

| Parameters ||
|---|---|
| `s` | `Serializable`: This value may be `null`. <br /> |

### writeSize

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeSize (Size val)
```

Flatten a Size into the parcel at the current dataPosition(), growing dataCapacity() if needed.

<br />

| Parameters ||
|---|---|
| `val` | `Size`: This value cannot be `null`. <br /> |

### writeSizeF

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeSizeF (SizeF val)
```

Flatten a SizeF into the parcel at the current dataPosition(), growing dataCapacity() if needed.

<br />

| Parameters ||
|---|---|
| `val` | `SizeF`: This value cannot be `null`. <br /> |

### writeSparseArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeSparseArray (SparseArray<T> val)
```

Flatten a generic SparseArray into the parcel at the current dataPosition(), growing dataCapacity() if needed. The SparseArray values are written using `https://developer.android.com/reference/android/os/Parcel#writeValue(java.lang.Object)` and must follow the specification there.

<br />

| Parameters ||
|---|---|
| `val` | `SparseArray`: This value may be `null`. <br /> |

### writeSparseBooleanArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeSparseBooleanArray (SparseBooleanArray val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `SparseBooleanArray`: This value may be `null`. <br /> |

### writeString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeString (String val)
```

Write a string value into the parcel at the current dataPosition(), growing dataCapacity() if needed.

<br />

| Parameters ||
|---|---|
| `val` | `String`: This value may be `null`. <br /> |

### writeStringArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeStringArray (String[] val)
```

<br />

<br />

| Parameters ||
|---|---|
| `val` | `String`: This value may be `null`. <br /> |

### writeStringList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeStringList (List<String> val)
```

Flatten a List containing String objects into the parcel, at the current dataPosition() and growing dataCapacity() if needed. They can later be retrieved with `https://developer.android.com/reference/android/os/Parcel#createStringArrayList()` or `https://developer.android.com/reference/android/os/Parcel#readStringList(java.util.List<java.lang.String>)`.

<br />

| Parameters ||
|---|---|
| `val` | `List`: The list of strings to be written. This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#createStringArrayList()`
- `https://developer.android.com/reference/android/os/Parcel#readStringList(java.util.List<java.lang.String>)`

### writeStrongBinder

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeStrongBinder (IBinder val)
```

Write an object into the parcel at the current dataPosition(), growing dataCapacity() if needed.

<br />

| Parameters ||
|---|---|
| `val` | `IBinder` <br /> |

### writeStrongInterface

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeStrongInterface (IInterface val)
```

Write an object into the parcel at the current dataPosition(), growing dataCapacity() if needed.

<br />

| Parameters ||
|---|---|
| `val` | `IInterface` <br /> |

### writeTypedArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeTypedArray (T[] val, 
                int parcelableFlags)
```

Flatten a homogeneous array containing a particular object type into the parcel, at the current dataPosition() and growing dataCapacity() if needed. The type of the objects in the array must be one that implements Parcelable. Unlike the `https://developer.android.com/reference/android/os/Parcel#writeParcelableArray(T[],%20int)` method, however, only the raw data of the objects is written and not their type, so you must use `https://developer.android.com/reference/android/os/Parcel#readTypedArray(T[],%20android.os.Parcelable.Creator<T>)` with the correct corresponding `https://developer.android.com/reference/android/os/Parcelable.Creator` implementation to unmarshall them.

<br />

| Parameters ||
|---|---|
| `val` | `T`: The array of objects to be written. This value may be `null`. <br /> |
| `parcelableFlags` | `int`: Contextual flags as per `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#readTypedArray(T[],%20android.os.Parcelable.Creator<T>)`
- `https://developer.android.com/reference/android/os/Parcel#writeParcelableArray(T[],%20int)`
- `https://developer.android.com/reference/android/os/Parcelable.Creator`

### writeTypedArrayMap

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeTypedArrayMap (ArrayMap<String, T> val, 
                int parcelableFlags)
```

Flatten an `https://developer.android.com/reference/android/util/ArrayMap` with string keys containing a particular object type into the parcel at the current dataPosition() and growing dataCapacity() if needed. The type of the objects in the array must be one that implements Parcelable. Only the raw data of the objects is written and not their type, so you must use the corresponding `https://developer.android.com/reference/android/os/Parcel#createTypedArrayMap(android.os.Parcelable.Creator<T>)`

<br />

| Parameters ||
|---|---|
| `val` | `ArrayMap`: The map of objects to be written. This value may be `null`. <br /> |
| `parcelableFlags` | `int`: The parcelable flags to use. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#createTypedArrayMap(android.os.Parcelable.Creator<T>)`
- `https://developer.android.com/reference/android/os/Parcelable`

### writeTypedList

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeTypedList (List<T> val, 
                int parcelableFlags)
```

Flatten a List containing a particular object type into the parcel, at the current dataPosition() and growing dataCapacity() if needed. The type of the objects in the list must be one that implements Parcelable. Unlike the generic writeList() method, however, only the raw data of the objects is written and not their type, so you must use the corresponding readTypedList() to unmarshall them.

<br />

| Parameters ||
|---|---|
| `val` | `List`: The list of objects to be written. This value may be `null`. <br /> |
| `parcelableFlags` | `int`: Contextual flags as per `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#createTypedArrayList(android.os.Parcelable.Creator<T>)`
- `https://developer.android.com/reference/android/os/Parcel#readTypedList(java.util.List<T>,%20android.os.Parcelable.Creator<T>)`
- `https://developer.android.com/reference/android/os/Parcelable`

### writeTypedList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeTypedList (List<T> val)
```

Flatten a List containing a particular object type into the parcel, at the current dataPosition() and growing dataCapacity() if needed. The type of the objects in the list must be one that implements Parcelable. Unlike the generic writeList() method, however, only the raw data of the objects is written and not their type, so you must use the corresponding readTypedList() to unmarshall them.

<br />

| Parameters ||
|---|---|
| `val` | `List`: The list of objects to be written. This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#createTypedArrayList(android.os.Parcelable.Creator<T>)`
- `https://developer.android.com/reference/android/os/Parcel#readTypedList(java.util.List<T>,%20android.os.Parcelable.Creator<T>)`
- `https://developer.android.com/reference/android/os/Parcelable`

### writeTypedObject

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeTypedObject (T val, 
                int parcelableFlags)
```

Flatten the Parcelable object into the parcel.

<br />

| Parameters ||
|---|---|
| `val` | `T`: The Parcelable object to be written. This value may be `null`. <br /> |
| `parcelableFlags` | `int`: Contextual flags as per `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#readTypedObject(android.os.Parcelable.Creator<T>)`

### writeTypedSparseArray

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeTypedSparseArray (SparseArray<T> val, 
                int parcelableFlags)
```

Flatten a `https://developer.android.com/reference/android/util/SparseArray` containing a particular object type into the parcel at the current dataPosition() and growing dataCapacity() if needed. The type of the objects in the array must be one that implements Parcelable. Unlike the generic `https://developer.android.com/reference/android/os/Parcel#writeSparseArray(android.util.SparseArray<T>)` method, however, only the raw data of the objects is written and not their type, so you must use the corresponding `https://developer.android.com/reference/android/os/Parcel#createTypedSparseArray(android.os.Parcelable.Creator<T>)`.

<br />

| Parameters ||
|---|---|
| `val` | `SparseArray`: The list of objects to be written. This value may be `null`. <br /> |
| `parcelableFlags` | `int`: The parcelable flags to use. <br /> |

**See also:**

- `https://developer.android.com/reference/android/os/Parcel#createTypedSparseArray(android.os.Parcelable.Creator<T>)`
- `https://developer.android.com/reference/android/os/Parcelable`

### writeValue

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeValue (Object v)
```

Flatten a generic object in to a parcel. The given Object value may currently be one of the following types:

- null
- String
- Byte
- Short
- Integer
- Long
- Float
- Double
- Boolean
- String\[\]
- boolean\[\]
- byte\[\]
- int\[\]
- long\[\]
- Object\[\] (supporting objects of the same type defined here).
- `https://developer.android.com/reference/android/os/Bundle`
- Map (as supported by `https://developer.android.com/reference/android/os/Parcel#writeMap(java.util.Map)`).
- Any object that implements the `https://developer.android.com/reference/android/os/Parcelable` protocol.
- Parcelable\[\]
- CharSequence (as supported by `https://developer.android.com/reference/android/text/TextUtils#writeToParcel(java.lang.CharSequence,%20android.os.Parcel,%20int)`).
- List (as supported by `https://developer.android.com/reference/android/os/Parcel#writeList(java.util.List)`).
- `https://developer.android.com/reference/android/util/SparseArray` (as supported by `https://developer.android.com/reference/android/os/Parcel#writeSparseArray(android.util.SparseArray<T>)`).
- `https://developer.android.com/reference/android/os/IBinder`
- Any object that implements Serializable (but see `https://developer.android.com/reference/android/os/Parcel#writeSerializable(java.io.Serializable)` for caveats). Note that all of the previous types have relatively efficient implementations for writing to a Parcel; having to rely on the generic serialization approach is much less efficient and should be avoided whenever possible.

`https://developer.android.com/reference/android/os/Parcelable` objects are written with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)` using contextual flags of 0. When serializing objects containing `https://developer.android.com/reference/android/os/ParcelFileDescriptor`s, this may result in file descriptor leaks when they are returned from Binder calls (where `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` should be used).

<br />

<br />

| Parameters ||
|---|---|
| `v` | `Object`: This value may be `null`. <br /> |

## Protected methods

### finalize

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void finalize ()
```

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. A subclass overrides the `finalize` method to dispose of system resources or to perform other cleanup.

The general contract of `finalize` is that it is invoked if and when the Java virtual machine has determined that there is no longer any means by which this object can be accessed by any thread that has not yet died, except as a result of an action taken by the finalization of some other object or class which is ready to be finalized. The `finalize` method may take any action, including making this object available again to other threads; the usual purpose of `finalize`, however, is to perform cleanup actions before the object is irrevocably discarded. For example, the finalize method for an object that represents an input/output connection might perform explicit I/O transactions to break the connection before the object is permanently discarded.

The `finalize` method of class `Object` performs no special action; it simply returns normally. Subclasses of `Object` may override this definition.

The Java programming language does not guarantee which thread will invoke the `finalize` method for any given object. It is guaranteed, however, that the thread that invokes finalize will not be holding any user-visible synchronization locks when finalize is invoked. If an uncaught exception is thrown by the finalize method, the exception is ignored and finalization of that object terminates.

After the `finalize` method has been invoked for an object, no further action is taken until the Java virtual machine has again determined that there is no longer any means by which this object can be accessed by any thread that has not yet died, including possible actions by other objects or classes which are ready to be finalized, at which point the object may be discarded.

The `finalize` method is never invoked more than once by a Java virtual machine for any given object.

Any exception thrown by the `finalize` method causes the finalization of this object to be halted, but is otherwise ignored.

<br />

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/Throwable` |   |