Code example for Parcel

Methods: writeInt, writeLong, writeString

0
    return 0; 
  } 
 
  @Override 
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(relayPort);
    dest.writeLong(sessionId);
    dest.writeString(serverName);
  } 
 
  public static final Parcelable.Creator<SessionDescriptor> CREATOR =
    new Parcelable.Creator<SessionDescriptor>() 
  { 
    public SessionDescriptor createFromParcel(Parcel in) { 
      return new SessionDescriptor(in); 
    } 
 
    public SessionDescriptor[] newArray(int size) { 
      return new SessionDescriptor[size]; 
    } 
  };