Package com.dsi.ant.channel.ipc.utility
Class ParcelPacker
java.lang.Object
com.dsi.ant.channel.ipc.utility.ParcelPacker
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.- Since:
- 4.7.2
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ParcelPacker
public ParcelPacker(android.os.Parcel p) Start a new pack in the parcel. The pack MUST be unpacked using theParcelUnpacker
class. It is safe to embed packs within each other, but the correspondingfinish()
must be made in reverse order of the constructor calls.- Parameters:
p
- The parcel to start the pack in.- Since:
- 4.7.2
-
-
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.- Since:
- 4.7.2
-