I use the following sub to clone objects of user defined types.
Is there any chance to get the size of the object so that the buffer can properly sized?
B4X:
Sub CloneObject(source As Object) As Object
Dim raf As RandomAccessFile
Dim buf(1024) As Byte
Dim dest As Object
raf.Initialize3(buf, False)
raf.WriteObject( source, False, 0)
dest = raf.ReadObject(0)
Return dest
End Sub
Is there any chance to get the size of the object so that the buffer can properly sized?