title: Write a sub class of Parcelable to another Parcel
body: <p>I have a class that implements <code>Parcelable</code> interface:</p>
  
  <pre><code>class A implements Parcelable {
  
  }
  </code></pre>
  
  <p>I have another class <code>B</code> that contains an <code>A</code> object as an instance variable. In the <code>writeToPacel</code> inside class <code>B</code>, I want to write object <code>B</code> to the <code>Parcel</code>:</p>
  
  <pre><code>class B implements Parcelable{
  
      public void writeToParcel(Parcel dest, int flags) {
          dest.write ??? 
      }
  }
  </code></pre>
  
  <p>How can I write and read it?</p>