toIntChecked

inline fun Long.toIntChecked(what: String = "value"): Int(source)

Narrows this Long (e.g. an ASN.1 contentLength) to an Int, throwing Asn1Exception if it does not fit in 0..Int.MAX_VALUE. Convenience for call sites that need an Int (array sizing/indexing) but hold a Long length.