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.
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...
Me too. Transmit as strings if practicable for command and control. String representation is not only portable but also easy to debug through WireShark. And if you need to compact and/or hide use RLE compression and obfuscate with symmetrical XOR character-based encryption.