This is B4a "SendObject" coding
and this is "ReadObject" coding
How can i convert to B4i code. I try many times and no luck
Please help me.
B4X:
Sub SendObject (Obj As Object)
raf.WriteObject(Obj, True, 0)
Dim size As Int = raf.CurrentPosition
Dim data(size) As Byte
raf.CurrentPosition = 0
Do While raf.CurrentPosition < size
raf.ReadBytes(data, raf.CurrentPosition, size - raf.CurrentPosition, _
raf.CurrentPosition)
Loop
Dim j As HttpJob
j.Initialize("send object", Me)
j.PostBytes(link & "/Attendee_Location", data)
End Sub
and this is "ReadObject" coding
B4X:
Public Sub ReadObject (In As InputStream) As Object
Dim out As OutputStream
out.InitializeToBytesArray(0)
File.Copy2(In, out)
Dim raf2 As RandomAccessFile
raf2.Initialize3(out.ToBytesArray, False)
Dim res As Object = raf2.ReadObject(0)
raf2.Close
Return res
End Sub
How can i convert to B4i code. I try many times and no luck
Please help me.
Last edited: