Compare two byte arrays and find which one is bigger [closed]

Perhaps converting to long and comparing would help you?

// Note: you should ensure that the arrays have at least 8 bytes!
// Although from your edits, it sounds like your "jagged" array isn't jagged at all
if (BitConverter.ToUInt64(max,0) > BitConverter.ToUInt64(arr,0)) 
    // do whatever.

But beware of byte order differences. This will work if your timestamp is simply a number of ticks. If it’s actually a date, you’ll need to figure out the appropriate conversion.

Leave a Comment