Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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