Java tutorial
//package com.java2s; //License from project: Apache License import android.os.Bundle; import android.os.Parcel; public class Main { public static Bundle mutate(Bundle bundle) { if (bundle == null) { return null; } final Parcel in = Parcel.obtain(); in.writeBundle(bundle); final byte[] bytes = in.marshall(); final Parcel out = Parcel.obtain(); out.unmarshall(bytes, 0, bytes.length); out.setDataPosition(0); try { return out.readBundle(); } finally { in.recycle(); out.recycle(); } } }