Serialization a class, is possible?

Priamo

Member
Licensed User
Longtime User
Hi to all,
i Would know if is possible to serialize a class into a string, and send it with a socket on the lan. After deserialize the string received from tha Astreams.
Thanks.
 

Priamo

Member
Licensed User
Longtime User
Hi, thanks for the answers.
This is my code
B4X:
Dim cls as class1
cls.codice="678910"
dim lst as List
lst.Initialize
lst.add(cls)
Dim p as JSONGenerator
p.Initialize2(lst)
Dim a as string
a=p.Tostring
Dim Buffer() as byte
Buffer =a.GetBiytes(("UTF8")
AStreams.Write(Buffer)
This is a part of the code of the app, here, how you can see, send a class serialized with Json to an app .Net on windows, this is the result that i receive:
["[bgkservice=null, codice=678910, kioskservice=null\n, main=null]"]
the data arrive, but the format is strange not is JSon format.
Now i want to deserialize on the server, but if the format is incorrect, how can i do?
 
Upvote 0
Top