public const int NotFound = -1; public static int GetPositionOfLastByteWithData(this byte[] array) { for (int i = array.Length - 1; i > -1; i--) { if (array[i] > 0) { return i; } } return NotFound; }
public const int NotFound = -1; public static int GetPositionOfLastByteWithData(this byte[] array) { for (int i = array.Length - 1; i > -1; i--) { if (array[i] > 0) { return i; } } return NotFound; }