Exemplo n.º 1
0
        internal Tokenizer(byte[] array, ByteTokenEncoding encoding, int startIndex)
        {
            BasicInitialization();
            _inBytes = array;
            _inSize  = array.Length;
            _inIndex = startIndex;

            switch (encoding)
            {
            case ByteTokenEncoding.UnicodeTokens:
                _inTokenSource = TokenSource.UnicodeByteArray;
                break;

            case ByteTokenEncoding.UTF8Tokens:
                _inTokenSource = TokenSource.UTF8ByteArray;
                break;

            case ByteTokenEncoding.ByteTokens:
                _inTokenSource = TokenSource.ASCIIByteArray;
                break;

            default:
                throw new ArgumentException("Arg_EnumIllegalVal");
            }
        }
        internal Tokenizer(byte[] array, ByteTokenEncoding encoding, int startIndex)
        {
            BasicInitialization();
            _inBytes = array;
            _inSize  = array.Length;
            _inIndex = startIndex;

            switch (encoding)
            {
            case ByteTokenEncoding.UnicodeTokens:
                _inTokenSource = TokenSource.UnicodeByteArray;
                break;

            case ByteTokenEncoding.UTF8Tokens:
                _inTokenSource = TokenSource.UTF8ByteArray;
                break;

            case ByteTokenEncoding.ByteTokens:
                _inTokenSource = TokenSource.ASCIIByteArray;
                break;

            default:
                throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Arg_EnumIllegalVal"), (int)encoding));
            }
        }
Exemplo n.º 3
0
        internal Tokenizer(byte[] array, ByteTokenEncoding encoding, int startIndex)
        {
            this.BasicInitialization();
            this._inBytes = array;
            this._inSize  = array.Length;
            this._inIndex = startIndex;
            switch (encoding)
            {
            case ByteTokenEncoding.UnicodeTokens:
                this._inTokenSource = TokenSource.UnicodeByteArray;
                return;

            case ByteTokenEncoding.UTF8Tokens:
                this._inTokenSource = TokenSource.UTF8ByteArray;
                return;

            case ByteTokenEncoding.ByteTokens:
                this._inTokenSource = TokenSource.ASCIIByteArray;
                return;
            }
            throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", new object[] { (int)encoding }));
        }
Exemplo n.º 4
0
        internal Tokenizer (byte[] array, ByteTokenEncoding encoding, int startIndex)
           {
            BasicInitialization();
            _inBytes = array;
            _inSize = array.Length;
            _inIndex = startIndex;

            switch (encoding)
            {
            case ByteTokenEncoding.UnicodeTokens:
                _inTokenSource = TokenSource.UnicodeByteArray;
                break;

            case ByteTokenEncoding.UTF8Tokens:
                _inTokenSource = TokenSource.UTF8ByteArray;
                break;

            case ByteTokenEncoding.ByteTokens:
                _inTokenSource = TokenSource.ASCIIByteArray;
                break;

            default:
                throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)encoding));
            }
           }