In the scenario where the data source is empty the library crashes throwing Method java.lang.IndexOutOfBoundsException exception.
Code used to test this:
assertNull(BerTlv.parse("".toByteArray()))
I think this can be easily fixed by this change in the BerTlv.java class:
@JvmStatic
fun parse(data: ByteArray): BerTlv {
if (data.isNotEmpty()) {
return parseList(ByteBuffer.wrap(data), true)[0]
} else {
null
}
}