Encog.Util.StringUtil.FromBytes C# (CSharp) Method

FromBytes() public static method

Simple utility to take an array of ASCII bytes and convert to a String. Works with Silverlight as well.
public static FromBytes ( byte b ) : String
b byte The byte array.
return String
        public static String FromBytes(byte[] b)
        {
            var b2 = new byte[b.Length*2];
            for (int i = 0; i < b.Length; i++)
            {
                b2[i*2] = b[i];
                b2[(i*2) + 1] = 0;
            }

            return (new UnicodeEncoding()).GetString(b2, 0, b2.Length);
        }
    }