Results 1 to 2 of 2

Thread: Byte array union removes 0's???

  1. #1

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Byte array union removes 0's???

    I have two byte arrays and when I try to union them together the 0's are removed from the second byte array, how do I stop this from happening?

    send = Header.Union(buffer).ToArray

    'below is psudo code
    Header=52,0
    buffer=104,0,105,0
    send = 52,0,104,105

    Thanks,
    Kris

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Byte array union removes 0's???

    Union is a set operation, which means each value from the two operands will only appear once in the result. You want Concat rather than Union.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width