Hello ,
I need to send a jpeg in packets of maximum 30 bytes to a server.
The problem is that the jpeg are different sizes.
How do i divide it?
I tried this , but how to handle oneven total data size?
I need to send a jpeg in packets of maximum 30 bytes to a server.
The problem is that the jpeg are different sizes.
How do i divide it?
I tried this , but how to handle oneven total data size?
B4X:
Public Sub SendPhoto(data() As Byte)
Dim nbytes As Int=data.Length
Dim bc As ByteConverter
Dim ninp As Int
Dim bufjpg(30) As Byte
For ninp =0 To nbytes-1 Step 30
bc.ArrayCopy(data,ninp,bufjpg,0,30)
ptChannel.SendPublicCustomMessage(bufjpg,30)
Next
End Sub