Java tutorial
//package com.java2s; //License from project: Open Source License import android.os.Parcel; import android.os.Parcelable; public class Main { public static Parcel deserialize(byte[] bytes) { Parcel parcel = Parcel.obtain(); parcel.unmarshall(bytes, 0, bytes.length); parcel.setDataPosition(0); return parcel; } public static <T> T deserialize(byte[] bytes, Parcelable.Creator<T> creator) { Parcel parcel = deserialize(bytes); return creator.createFromParcel(parcel); } }