Code example for Parcel

Methods: writeByteArray, writeInt

0
        } 
 
        public void writeToParcel(Parcel dest, int flags) {
            try { 
                byte[] data = BinaryPropertyListWriter.writeToArray(array);
                dest.writeInt(data.length);
                dest.writeByteArray(data);
            } catch (Exception e) {
                e.printStackTrace();
            } 
        } 
        // this is used to regenerate your object. All Parcelables must have a CREATOR that implements these two methods 
        public static final Parcelable.Creator<NSArrayWrapper> CREATOR = new Parcelable.Creator<NSArrayWrapper>() {
            public NSArrayWrapper createFromParcel(Parcel in) { 
                return new NSArrayWrapper(in); 
            } 
 
            public NSArrayWrapper[] newArray(int size) { 
                return new NSArrayWrapper[size]; 
            } 
        };