From 56d59bd455a995baccaadef4c5788f0bcfc1aef5 Mon Sep 17 00:00:00 2001 From: Robinson Date: Sat, 5 Aug 2023 19:50:36 -0600 Subject: [PATCH] Throws Exception instead of RuntimeException --- src/dorkbox/bytes/ArrayExtensions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dorkbox/bytes/ArrayExtensions.kt b/src/dorkbox/bytes/ArrayExtensions.kt index b083a2d..b8ecc18 100644 --- a/src/dorkbox/bytes/ArrayExtensions.kt +++ b/src/dorkbox/bytes/ArrayExtensions.kt @@ -93,7 +93,7 @@ fun IntArray.toBytes(start: Int = 0, length: Int = this.size): ByteArray { for (i in start until endPosition) { val intValue = this[i] if (intValue < 0 || intValue > 255) { - throw IllegalArgumentException("Int at index $i($intValue) was not a valid byte value (0-255)") + throw Exception("Int at index $i($intValue) was not a valid byte value (0-255)") } bytes[j++] = intValue.toByte() }