convert bytes to long value

Discussion in 'ASP .Net' started by Paul, Nov 24, 2004.

  1. Paul

    Paul Guest

    I need to convert 4 bytes into a long. In C I would do long l = *(long
    *)&buffer[10]; buffer is an array of bytes read from a file. What's the
    C# syntax?
    Paul, Nov 24, 2004
    #1
    1. Advertising

  2. Use the System.BitConverter class to convert the array of bytes to an Int64
    value.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Neither a follower
    nor a lender be.

    "Paul" <> wrote in message
    news:#...
    > I need to convert 4 bytes into a long. In C I would do long l = *(long
    > *)&buffer[10]; buffer is an array of bytes read from a file. What's the
    > C# syntax?
    >
    >
    Kevin Spencer, Nov 24, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    657
    Eric Sosman
    Jul 8, 2003
  2. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,174
    Peter Shaggy Haywood
    Sep 20, 2005
  3. Yandos
    Replies:
    12
    Views:
    5,097
    Pete Becker
    Sep 15, 2005
  4. Replies:
    5
    Views:
    278
    dprody
    Nov 5, 2007
  5. Steven D'Aprano
    Replies:
    8
    Views:
    388
    Helmut Jarausch
    Jan 21, 2010
Loading...

Share This Page