System.Xml.BinHexDecoder.Decode C# (CSharp) Méthode

Decode() private méthode

private Decode ( char chars, int startPos, int len ) : int
chars char
startPos int
len int
Résultat int
        internal override unsafe int Decode( char[] chars, int startPos, int len ) {
            Debug.Assert( chars != null );
            Debug.Assert( len >= 0 );
            Debug.Assert( startPos >= 0 );
            Debug.Assert( chars.Length - startPos >= len );

            if ( len == 0 ) {
                return 0;
            }
            int bytesDecoded, charsDecoded;
            fixed ( char* pChars = &chars[startPos] ) {
                fixed ( byte* pBytes = &buffer[curIndex] ) {
                    Decode( pChars, pChars + len, pBytes, pBytes + ( endIndex - curIndex ),  
                            ref this.hasHalfByteCached, ref this.cachedHalfByte, out charsDecoded, out bytesDecoded );
                }
            }
            curIndex += bytesDecoded;
            return charsDecoded;
        }

Same methods

BinHexDecoder::Decode ( char chars, bool allowOddChars ) : byte[]
BinHexDecoder::Decode ( string str, int startPos, int len ) : int
BinHexDecoder::Decode ( char pChars, char pCharsEndPos, byte pBytes, byte pBytesEndPos, bool &hasHalfByteCached, byte &cachedHalfByte, int &charsDecoded, int &bytesDecoded ) : void

Usage Example

Exemple #1
0
 internal static byte[] FromBinHexString(string s, bool allowOddCount)
 {
     if (s == null)
     {
         throw new ArgumentNullException("s");
     }
     return(BinHexDecoder.Decode(s.ToCharArray(), allowOddCount));
 }