def text_event(data: Union[FileIO, BufferedReader]) -> Tuple[int, str, bytearray]:
length = VariableLengthValue(data).value
raw_data = bytearray(data.read(length))
try:
text = raw_data.decode("ASCII")
except UnicodeDecodeError as exc:
raise EventTextError("Unparsable text in text event") from exc
return length, text, raw_data
评论列表
文章目录