mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 03:57:32 +00:00
fix[BigEndianBitConverter]: Fix ToLong and ToUlong overflow errors
This commit is contained in:
parent
e84bc721ee
commit
138a6f3470
1 changed files with 2 additions and 2 deletions
|
|
@ -78,9 +78,9 @@ namespace ICD.Common.Utils
|
||||||
if (startIndex > value.Length - bytes)
|
if (startIndex > value.Length - bytes)
|
||||||
throw new ArgumentException("Array plus start index too small");
|
throw new ArgumentException("Array plus start index too small");
|
||||||
|
|
||||||
int result = 0;
|
long result = 0;
|
||||||
for (int i = 0; i < bytes; i++)
|
for (int i = 0; i < bytes; i++)
|
||||||
result |= value[i + startIndex] << GetBitShift(i, bytes);
|
result |= (long)(value[i + startIndex]) << GetBitShift(i, bytes);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue