You also can try to use a map, add the bytearray to the map and then use jsongenerator to build the json from the map.
Don´t know if it is compatible but i guess it should do the trick.
Sub Activity_Create(FirstTime As Boolean)
Log(Convert("abcde"))
End Sub
Sub Convert(input As String) As String
Dim bc As ByteConverter
Dim sb As StringBuilder
sb.Initialize
Dim hex As String = bc.HexFromBytes(input.GetBytes("utf8"))
For i = 0 To hex.Length - 1 Step 2
sb.Append("\x").Append(hex.SubString2(i, i + 2))
Next
Return sb.ToString
End Sub