Hi i have the problem that i want to save "settings" to the esp8266 spiff file system.
for better handling i want to convert it with B4Rserializator.
as example:
this works and i can read back the values:
the problem is that i have 8 array of type, with 14 number of variables each .
is there a way to built the data () stream like this ?
this did not work.. and i know there must be a better way.
Or is it better to save as Json ?
thx
for better handling i want to convert it with B4Rserializator.
as example:
Custom Type:
Type daten ( value1 As Int,text As String)
Dim data_ar (2) As daten
data_ar(0).value1=1
data_ar(0).text="Text1"
data_ar(1).value1=2
data_ar(1).text="Text2"
Dim data() As Byte = serializator.ConvertArrayToBytes(Array(data_ar(0).value1,data_ar(0).text,data_ar(1).value1,data_ar(1).text))
this works and i can read back the values:
B4X:
Dim Obj() As Object = serializator.ConvertBytesToArray(data, ObjectsBuffer)
the problem is that i have 8 array of type, with 14 number of variables each .
is there a way to built the data () stream like this ?
B4X:
For i = 0 To XX
Dim data() As Byte = serializator.ConvertArrayToBytes(Array(data_ar(i).value1,data_ar(i))
Log(fs.OpenReadWrite("/daten.dat"))
Log ("write",fs.Stream.WriteBytes(data, fs.Position,data.Length))
fs.Position = fs.Position + data.Length-1
Next
this did not work.. and i know there must be a better way.
Or is it better to save as Json ?
thx