parse array

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

    #1

    parse array

    i have an aray of bites
    " private byte[] ByteArray = new byte[4000]; "
    How can i parse this array to read integers, in other words
    assign first 4 bytes to one integer variable, second 4 bytes to another
    itneger variable and so on...

    Thanks...

  • Mattias Sjögren

    #2
    Re: parse array

    [color=blue]
    >i have an aray of bites
    >" private byte[] ByteArray = new byte[4000]; "
    >How can i parse this array to read integers, in other words
    >assign first 4 bytes to one integer variable, second 4 bytes to another
    >itneger variable and so on...[/color]

    Use Buffer.BlockCop y() to copy it all over to an int[], or use
    BitConverter.To Int32() to read one int at the time.



    Mattias

    --
    Mattias Sjögren [MVP] mattias @ mvps.org

    Please reply only to the newsgroup.

    Comment

    Working...