Android Question [WriteInt] Socket Usage ???

Peppe B

Member
Licensed User
I have the following code in java.

How do I apply writeint in b4a???

I only have these options with b4a
AStreamsClient.Write
AStreamsClient.Write2
AStreamsClient.WriteStream
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should add the screenshot directly in your post.

B4X:
Dim header() As Byte = "SCREEN".GetBytes("UTF8")
Dim arr() As Byte
Dim buffer(header.Length + arr.Length + 4) As Byte
Dim raf As RandomAccessFile
raf.Initialize3(buffer, True)
raf.WriteBytes(header, 0, header.Length, raf.CurrentPosition)
raf.WriteBytes(arr, 0, arr.Length, raf.CurrentPosition)
raf.WriteInt(raf.CurrentPosition, raf.CurrentPosition)
astream.write(buffer)
 
Upvote 0
Top