Is it possible to log a byte array into the log window without converting it?
On the Buffer() array from Astreams there is a character or something getting in there thats causing the Bytestostring to crash, but I cannot tell what.
Above code works fine until something gets in the buffer that causes a "Cannot parse as string" crash which ends up in the "Catch" routine.
Of course the Try-Catch prevents my program from crashing and I eventually get the right response and everything is fine. BUT, I cannot help but wonder as to why...
any ideas?
On the Buffer() array from Astreams there is a character or something getting in there thats causing the Bytestostring to crash, but I cannot tell what.
B4X:
Try
RxPacket = RxPacket & BytesToString(Buffer, 0, Buffer.Length, "UTF8")
Catch
RxPacket = ""
#IF DEBUG
Log("Non string character detected in buffer, flushing.")
#End If
Return
End Try
Above code works fine until something gets in the buffer that causes a "Cannot parse as string" crash which ends up in the "Catch" routine.
Of course the Try-Catch prevents my program from crashing and I eventually get the right response and everything is fine. BUT, I cannot help but wonder as to why...
any ideas?
Last edited: