Afternoon all,
Coming up against a brick wall with sending items over the network using sockets. I'm using Chilkat rather than the built in TCP Client / listener but thats not the issue. From point a I send through a string converted to base64 as below
So at point b I want to convert that back and the code I have is as follows:Code:Public Function fn_ArrayListToBytes(ByVal arrTmp As ArrayList) As Byte() Dim rawFoo As New MemoryStream Dim formatterIn As New BinaryFormatter formatterIn.Serialize(rawFoo, arrTmp) rawFoo.Seek(0, SeekOrigin.Begin) Dim fooBytes As Byte() = New Byte(rawFoo.Length) {} rawFoo.Read(fooBytes, 0, rawFoo.Length) Return fn_encrypt_byte(fooBytes) End Function
Code:Public Function fn_ArrayListFromBytes(ByVal bytTmp As Byte()) As ArrayList Dim objBinaryFormatter As New BinaryFormatter Dim newRawFoo As New MemoryStream(fn_decrypt_byte(bytTmp)) Dim RebuiltArraylist As ArrayList = objBinaryFormatter.Deserialize(newRawFoo) Return RebuiltArraylist End Function


Reply With Quote
