public static string GetStringFromBinary(byte[] bytes, bool isFirstTwoByteStoreLength) { StringBuilder stringByteValue = new StringBuilder(); foreach (byte by in bytes) { stringByteValue.Append(by.ToString("X2")); } if (isFirstTwoByteStoreLength) { // Del first four byte which store the byte array length stringByteValue.Remove(0, 4); } return stringByteValue.ToString(); }