Function binder_ndk_sys::AParcel_marshal

source ยท
pub unsafe extern "C" fn AParcel_marshal(
    parcel: *const AParcel,
    buffer: *mut u8,
    start: usize,
    len: usize,
) -> binder_status_t
Expand description

Marshals the raw bytes of the Parcel to a buffer.

Available since API level 33.

The parcel must not contain any binders or file descriptors.

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.

\param parcel The parcel of which to get the data. \param buffer The buffer to copy the raw bytes to. \param start The start position in the buffer to copy from. \param len The size of the data to copy, buffer size must be larger or equal to this.

\return STATUS_OK on success, STATUS_INVALID_OPERATION if parcel contains binders or file descriptors. STATUS_BAD_VALUE if the buffer size is less than parcel size.