Implement read for Boolean and ByteArray

This commit is contained in:
RunasSudo 2025-04-21 16:54:56 +10:00
parent 5ab3a42a09
commit 75685bb3cb
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -111,7 +111,8 @@ class CslaBinaryReader:
known_type = self.stream.read(1)[0]
if known_type == CslaKnownTypes.Boolean.value:
raise NotImplementedError()
value = self.stream.read(1)[0]
return True if value > 0 else False
if known_type == CslaKnownTypes.Char.value:
raise NotImplementedError()
@ -165,7 +166,8 @@ class CslaBinaryReader:
raise NotImplementedError()
if known_type == CslaKnownTypes.ByteArray.value:
raise NotImplementedError()
length = self.read_int32()
return self.stream.read(length)
if known_type == CslaKnownTypes.CharArray.value:
raise NotImplementedError()