FromBinHexString() статический приватный Метод

static private FromBinHexString ( string s ) : byte[]
s string
Результат byte[]
Пример #1
0
        public int ReadBinHex(byte [] buffer, int offset, int length)
        {
            if (offset < 0)
            {
                throw CreateArgumentOutOfRangeException("offset", offset, "Offset must be non-negative integer.");
            }
            else if (length < 0)
            {
                throw CreateArgumentOutOfRangeException("length", length, "Length must be non-negative integer.");
            }
            else if (buffer.Length < offset + length)
            {
                throw new ArgumentOutOfRangeException("buffer length is smaller than the sum of offset and length.");
            }

            if (length == 0)
            {
                return(0);
            }

            char [] chars       = new char [length * 2];
            int     charsLength = getter != null?
                                  getter(chars, 0, length * 2) :
                                      ReadValueChunk(chars, 0, length * 2);

            return(XmlConvert.FromBinHexString(chars, offset, charsLength, buffer));
        }
        public int ReadBinHex(byte[] buffer, int offset, int length)
        {
            if (offset < 0)
            {
                throw XmlReaderBinarySupport.CreateArgumentOutOfRangeException("offset", offset, "Offset must be non-negative integer.");
            }
            if (length < 0)
            {
                throw XmlReaderBinarySupport.CreateArgumentOutOfRangeException("length", length, "Length must be non-negative integer.");
            }
            if (buffer.Length < offset + length)
            {
                throw new ArgumentOutOfRangeException("buffer length is smaller than the sum of offset and length.");
            }
            if (length == 0)
            {
                return(0);
            }
            char[] array      = new char[length * 2];
            int    charLength = (this.getter == null) ? this.ReadValueChunk(array, 0, length * 2) : this.getter(array, 0, length * 2);

            return(XmlConvert.FromBinHexString(array, offset, charLength, buffer));
        }
Пример #3
0
 public static byte [] StringToHexBinary(string value)
 {
     return(XmlConvert.FromBinHexString(value));
 }
Пример #4
0
 public static byte [] Base64BinaryToHexBinary(byte [] value)
 {
     return(XmlConvert.FromBinHexString(Convert.ToBase64String(value)));
 }
Пример #5
0
 public static byte [] ItemToHexBinary(XPathItem value)
 {
     return(XmlConvert.FromBinHexString(value.Value));
 }