/// <summary>
        /// Byte array to Integer
        /// </summary>
        /// <param name="bytes">byte array</param>
        /// <returns>int</returns>
        public static int BytesToInt(byte[] bytes)
        {
            return int.Parse(BytesToString(bytes).Trim());
        }

        /// <summary>
        /// Byte array to String
        /// </summary>
        /// <param name="bytes">byte array</param>
        /// <returns>string</returns>
        public static string BytesToString(byte[] bytes)
        {
            ASCIIEncoding enc = new System.Text.ASCIIEncoding();

            return enc.GetString(bytes);
        }

        /// <summary>
        /// Integer to Byte array
        /// </summary>
        /// <param name="value">int</param>
        /// <returns>byte array</returns>
        public static byte[] IntToBytes(int value)
        {
            ASCIIEncoding enc = new System.Text.ASCIIEncoding();

            return enc.GetBytes(value.ToString());
        }

        /// <summary>
        /// Bytes to Integer
        /// </summary>
        /// <param name=”src”></param>
        /// <returns></returns>
        public static int BytesToInt(byte[] src)
        {
             if (src.Length == 1)
                 return (int)src[0];
             else if (src.Length <= 2)
                 return BitConverter.ToInt16(src, 0);

             return BitConverter.ToInt32(src, 0);
         }