Android Question [WriteInt] Socket Usage ???

Discussion in 'Android Questions' started by Amanda Sura, May 18, 2019.

Tags:
  1. Amanda Sura

    Amanda Sura Member Licensed User

    I have the following code in java.

    https://prnt.sc/nq9rep

    How do I apply writeint in b4a???

    I only have these options with b4a
    AStreamsClient.Write
    AStreamsClient.Write2
    AStreamsClient.WriteStream
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You should add the screenshot directly in your post.

    Code:
    Dim header() As Byte = "SCREEN".GetBytes("UTF8")
    Dim arr() As Byte
    Dim buffer(header.Length + arr.Length + 4As 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)
     
    Amanda Sura likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice