From 09d88dbb3fe6ce84853be095582f010ba340e12a Mon Sep 17 00:00:00 2001 From: rnentjes Date: Sun, 1 Sep 2024 21:14:41 +0200 Subject: [PATCH] Add ByteArray constructor --- src/commonMain/kotlin/nl/astraeus/tba/TypedByteArray.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/commonMain/kotlin/nl/astraeus/tba/TypedByteArray.kt b/src/commonMain/kotlin/nl/astraeus/tba/TypedByteArray.kt index 1dc479c..291c50c 100644 --- a/src/commonMain/kotlin/nl/astraeus/tba/TypedByteArray.kt +++ b/src/commonMain/kotlin/nl/astraeus/tba/TypedByteArray.kt @@ -18,4 +18,8 @@ open class TypedByteArray( index += type.size } } + + constructor(data: ByteArray): this(ByteArrayDefinition()) { + this.data = MutableByteArrayHandler(buffer = data) + } }