Tayfur Well-Known Member Licensed User Longtime User Feb 13, 2014 #1 Hello; I have data hex. Code: Copy dim data as string = "FFAACC1237A1D676" dim bytes() as byte bytes=data.tobyte '......(like tihs.)........ how is convert? i cant add bytearray. thank you for you feedback
Hello; I have data hex. Code: Copy dim data as string = "FFAACC1237A1D676" dim bytes() as byte bytes=data.tobyte '......(like tihs.)........ how is convert? i cant add bytearray. thank you for you feedback
E ernschd Active Member Licensed User Longtime User Feb 13, 2014 #2 With the ByteConverter library: Code: Copy Dim b As ByteConverter bytes = b.HexToBytes(Data) Upvote 0
Tayfur Well-Known Member Licensed User Longtime User Feb 13, 2014 #3 ernschd said: With the ByteConverter library: Code: Copy Dim b As ByteConverter bytes = b.HexToBytes(Data) Click to expand... I want to things. I convert to image file Code: Copy '****** THIS CODE VB.NET on PC *********************** Dim bytes = My.Computer.FileSystem.ReadAllBytes("X:\image.jpg") path = "" For i = 0 To bytes.Length - 1 If Conversion.Hex(bytes(i)).ToString.Length = 1 Then path = path & "0" & Conversion.Hex(bytes(i)) '.ToString Else path = path & Conversion.Hex(bytes(i)) '.ToString End If boy = path.Length Next i send_to_phone(path) I recived HEx data from server. After I save to phone image file "test.jpg" I cant save image. (I revice all hex data from server "data ="FF25AB1678A1B5C5.......") How can I save it image file Upvote 0
ernschd said: With the ByteConverter library: Code: Copy Dim b As ByteConverter bytes = b.HexToBytes(Data) Click to expand... I want to things. I convert to image file Code: Copy '****** THIS CODE VB.NET on PC *********************** Dim bytes = My.Computer.FileSystem.ReadAllBytes("X:\image.jpg") path = "" For i = 0 To bytes.Length - 1 If Conversion.Hex(bytes(i)).ToString.Length = 1 Then path = path & "0" & Conversion.Hex(bytes(i)) '.ToString Else path = path & Conversion.Hex(bytes(i)) '.ToString End If boy = path.Length Next i send_to_phone(path) I recived HEx data from server. After I save to phone image file "test.jpg" I cant save image. (I revice all hex data from server "data ="FF25AB1678A1B5C5.......") How can I save it image file
Erel B4X founder Staff member Licensed User Longtime User Feb 13, 2014 #4 I recommend you to encode the bytes with Base64 string instead. It will be more efficient. You can then decode it with StringUtils. Upvote 0
I recommend you to encode the bytes with Base64 string instead. It will be more efficient. You can then decode it with StringUtils.
BaGRoS Active Member Licensed User Longtime User Sep 3, 2017 #5 I have similar problem Now I have Code: Copy Private address(8) As Byte = Array As Byte(0x28, 0xFF, 0x8F, 0xB1, 0x68, 0x14, 0x03, 0x47) how convert 28FF8FB168140347 to address()? Upvote 0
I have similar problem Now I have Code: Copy Private address(8) As Byte = Array As Byte(0x28, 0xFF, 0x8F, 0xB1, 0x68, 0x14, 0x03, 0x47) how convert 28FF8FB168140347 to address()?
OliverA Expert Licensed User Longtime User Sep 3, 2017 #6 BaGRoS said: how convert 28FF8FB168140347 to address() Click to expand... Is 28FF8FB168140347 a string? If so, follow @ernschd's example. Upvote 0
BaGRoS said: how convert 28FF8FB168140347 to address() Click to expand... Is 28FF8FB168140347 a string? If so, follow @ernschd's example.
Erel B4X founder Staff member Licensed User Longtime User Sep 4, 2017 #7 Please start a new thread for your question. Upvote 0