B4J Question Concatenate byte array...

Discussion in 'B4J Questions' started by stefanoxjx, Feb 20, 2015.

  1. stefanoxjx

    stefanoxjx Active Member Licensed User

    Hi,
    I need to concatenate all packet received by AStream_NewData event in a one byte array.
    I don't know the final dimension of array and then I can't create it with fixed dimension.
    When I will have my unique array, I need to search string in it but without convert in string because during conversion, some binary data are modified.
    For example:
    fe 32 0 2 4 e8 3 21 56 d2 7 1a 63 22 9c (binary)
    fd 32 0 2 4 fd 3 21 56 fd 7 1a 63 22 fd (Same array converted to string)

    Exist some library or function that can help me?
    Thanks.

    Stefano
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Create a new array each time and use ByteConverter.CopyArray to copy the old array and the new data to the new array.

    The performance will be good assuming that the data is not huge.
     
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