Class ParcelPacker

java.lang.Object
com.dsi.ant.plugins.utility.parcel.ParcelPacker

public class ParcelPacker extends Object
Helper class for packing objects into a parcel in a forward-compatible way. When used with the companion class ParcelUnpacker it allows the writing and reading of objects that might have grown in size between IPC versions while maintaining a correct position in the parcel stream.
  • Constructor Details

    • ParcelPacker

      public ParcelPacker(android.os.Parcel p)
      Start a new pack in the parcel. The pack MUST be unpacked using the ParcelUnpacker class. It is safe to embed packs within each other, but the corresponding finish() must be made in reverse order of the constructor calls.
      Parameters:
      p - The parcel to start the pack in.
  • Method Details

    • finish

      public void finish()
      Mark the end of this pack in the parcel stream. This MUST be called to allow proper unpacking of the pack.