byte array concatenation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Prasad

    #1

    byte array concatenation

    hi everyone,

    This is prasad. I want to know how to concatenate two byte array
    variables, can somebody help me.

    thankx in advance.

  • Herfried K. Wagner [MVP]

    #2
    Re: byte array concatenation

    "Prasad" <prasad.p08@gma il.comschrieb:
    This is prasad. I want to know how to concatenate two byte array
    variables, can somebody help me.

    Check out 'Buffer.BlockCo py'.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

    Comment

    • Prasad

      #3
      Re: byte array concatenation

      Dear Herfried K Wagner,

      Thank you Herfried K Wagner for your reply, I'm new to this method can
      u please give an example for Buffer.BlockCop y. Please Don't mind that
      my question sounds silly. I'm learning vb.net, I'm creating a client
      and server application. Wherein the image stored in mysql database is
      fetched from server application and passed to client application. I use
      winsock connection, here i'm facing a problem in sending the image blob
      data as byte from Server -Client. I could able to see only half of
      the image.

      While tracing the program, the receiving function loops for 3 times. I
      understood this is because the packet size handled here is large and so
      it is being iterated for 3 times. So here i'm trying to concatenate the
      byte array which is being executed for 3 times. Please suggest me an
      efficient way to concatenate byte array.

      Thanx in advance.

      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: byte array concatenation

        "Prasad" <prasad.p08@gma il.comschrieb:
        Thank you Herfried K Wagner for your reply, I'm new to this method can
        u please give an example for Buffer.BlockCop y. Please Don't mind that
        my question sounds silly. I'm learning vb.net
        No problem -- check out the sample below:

        \\\
        Dim Data1() As Byte = {1, 2, 3, 4}
        Dim Data2() As Byte = {5, 6, 7, 8}
        Dim Data(Data1.Leng th + Data2.Length - 1) As Byte
        Buffer.BlockCop y(Data1, 0, Data, 0, Data1.Length)
        Buffer.BlockCop y(Data2, 0, Data, Data1.Length, Data2.Length)
        ///

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

        Comment

        Working...