Lucene.Net.Analysis.MockTokenizer.ReadChar C# (CSharp) Method

ReadChar() protected method

protected ReadChar ( ) : int
return int
        protected internal virtual int ReadChar()
        {
            switch (Random.Next(0, 10))
            {
                case 0:
                    {
                        // read(char[])
                        char[] c = new char[1];
                        int ret = input.Read(c, 0, c.Length);
                        return ret <= 0 ? -1 : c[0];
                    }
                case 1:
                    {
                        // read(char[], int, int)
                        char[] c = new char[2];
                        int ret = input.Read(c, 1, 1);
                        return ret <= 0 ? -1 : c[1];
                    }
                /* LUCENE TO-DO not sure if needed, CharBuffer not supported
                  case 2:
                  {
                    // read(CharBuffer)
                    char[] c = new char[1];
                    CharBuffer cb = CharBuffer.Wrap(c);
                    int ret = Input.Read(cb);
                    return ret < 0 ? ret : c[0];
                  }*/
                default:
                    // read()
                    return input.Read();
            }
        }