Created
March 20, 2022 12:12
-
-
Save le0nidas/38b5b711d4296e3c11881708a2418aca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun Parcelable.sizeInBytes(): Int { | |
val parcel = Parcel.obtain() | |
try { | |
parcel.writeParcelable(this, 0) | |
return parcel.dataSize() | |
} finally { | |
parcel.recycle() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment