Package-level declarations

This package contains utilities to serialize various types to Android's Parcel type.

Types

Link copied to clipboard
Link copied to clipboard
data class ParcelableBooleanList(val value: List<Boolean>) : Parcelable

Optimized parcelable wrapper for a list of booleans, suitable for Binder transactions.

Link copied to clipboard
data class ParcelableDoubleList(val value: List<Double>) : Parcelable

Optimized parcelable wrapper for a list of doubles, suitable for Binder transactions.

Link copied to clipboard
data class ParcelableEnum(className: String, ordinal: Int) : Parcelable

A Parcelable wrapper for enums, suitable for Binder transactions.

Link copied to clipboard

A parcelable variant of an Exception.

Link copied to clipboard
data class ParcelableFloatList(val value: List<Float>) : Parcelable

Optimized parcelable wrapper for a list of floats, suitable for Binder transactions.

Link copied to clipboard
data class ParcelableIntList(val value: List<Int>) : Parcelable

Optimized parcelable wrapper for a list of integers, suitable for Binder transactions.

Link copied to clipboard
data class ParcelableLongList(val value: List<Long>) : Parcelable

Optimized parcelable wrapper for a list of longs, suitable for Binder transactions.

Link copied to clipboard
data class ParcelableStringList(val value: List<String>) : Parcelable

Optimized parcelable wrapper for a list of strings, suitable for Binder transactions.

Link copied to clipboard
@IviExperimental(reasons = [])
data class ParcelableTraceEvent(val traceEvent: TraceEvent, val allArgumentsSupported: Boolean) : Parcelable

Parcelable TraceEvent.

Functions

Link copied to clipboard
inline fun <T : Enum<T>> Parcel.createEnumSetOptimized(elementReader: (Parcel) -> T): EnumSet<T>?

Creates and reads an EnumSet set with element type T from a Parcel, by invoking elementReader on each element of the EnumSet.

Link copied to clipboard
inline fun <T> Parcel.createListOptimized(elementReader: (Parcel) -> T): List<T>?

Creates and reads a list of elements of type T from a Parcel, by invoking elementReader on each element in the List.

Link copied to clipboard
inline fun <K, V> Parcel.createMapOptimized(entryReader: (Parcel) -> Pair<K, V>): Map<K, V>?

Creates and reads a map with key type K and value type V from a Parcel using entryReader.

Link copied to clipboard
inline fun <T> Parcel.createSetOptimized(elementReader: (Parcel) -> T): Set<T>?

Creates and reads a set with element type T from a Parcel, by invoking elementReader on each element in the Set.

Link copied to clipboard
inline fun <T> Parcel.createSparseArrayOptimized(elementReader: (Parcel) -> T): SparseArray<T>?
Link copied to clipboard
inline fun <T> Parcel.readArrayCompat(classLoader: ClassLoader?): Array<out T>?

Reads a Array of T from a Parcel. Same as Parcel.readArray, except this function also works on Android 12 and earlier.

Link copied to clipboard

Reads a Boolean from a Parcel. Same as Parcel.readBoolean, except this function also works on Android 8.1.

Link copied to clipboard

Reads a nullable Int from the Parcel receiver.

Link copied to clipboard

Reads a Parcelable from a Parcel. Same as Parcel.readParcelable, except this function also works on Android 12 and earlier.

Link copied to clipboard

Overload of Parcel.readParcelable to read Parcel objects, while allowing type flexibility.

Overload of Parcel.readParcelable to read VersionedParcelable objects, while allowing type flexibility.

Link copied to clipboard

Reads a Serializable from a Parcel. Same as Parcel.readSerializable, except this function also works on Android 12 and earlier.

Link copied to clipboard
@IviExperimental(reasons = [])
fun TraceEvent.toMarshalled(): MarshalledTraceEvent

Converts this TraceEvent to a MarshalledTraceEvent.

Link copied to clipboard
Link copied to clipboard

Writes a Boolean to a Parcel. Same as Parcel.writeBoolean, except this function also works on Android 8.1.

Link copied to clipboard
inline fun <T> Parcel.writeCollectionOptimized(collection: Collection<T>?, elementWriter: (Parcel, T) -> Unit)

Optimized way to write a collection of T objects to a Parcel.

Link copied to clipboard
inline fun <K, V> Parcel.writeMapOptimized(map: Map<K, V>?, entryWriter: (Parcel, Map.Entry<K, V>) -> Unit)

Optimized and more feature rich way to write a map of K key-V value pairs to a Parcel.

Link copied to clipboard

Writes a nullable Int to the Parcel receiver.

Link copied to clipboard
fun Parcel.writeParcelableCustom(parcelable: Parcelable?, parcelableFlags: Int)

Overload of Parcel.readParcelable to read Parcel objects, while allowing type flexibility.

fun Parcel.writeParcelableCustom(versionedParcelable: VersionedParcelable?, parcelableFlags: Int): Boolean

Overload of Parcel.readParcelable to read VersionedParcelable objects, while allowing type flexibility.

Link copied to clipboard
inline fun <T> Parcel.writeSparseArrayOptimized(sparseArray: SparseArray<T>?, elementWriter: (Parcel, T) -> Unit)
Link copied to clipboard

Writes array to the Parcel, like Parcel.writeArray. Except this function will not throw a RuntimeException when the array contains an element that is not supported by Parcel.writeValue.