Create a SparseInputstream

SparseInputStream read from upstream and detects the data format.
If the upstream is a valid sparse data, it will unsparse it on the fly.
Otherwise, it just passthrough as is.

Bug: 139510436
Test: \
   java com.android.dynsystem.SparseInputStream system.img system.raw
   simg2img system.img system.raw.golden
   diff system.raw system.raw.golden

Change-Id: Ibc5c130127a455392484467fe32d638be642afa8
1 file changed