BTTool.CommonAnalyser.AnalyseString C# (CSharp) Method

AnalyseString() private method

private AnalyseString ( ) : byte[]
return byte[]
        private byte[] AnalyseString()
        {
            char currentChar = GetCurrentCharMove();
            // 字符串一定是数字开始开始
            if (currentChar < '0' || currentChar > '9')
                return null;

            StringBuilder builder = new StringBuilder();

            do
            {
                builder.Append(currentChar);
                currentChar = GetCurrentCharMove();
            } while (currentChar >= '0' && currentChar <= '9');

            // 中间必须为:
            if (currentChar != ':')
                return null;

            int length = Int32.Parse(builder.ToString());
            byte[] buffer = new byte[length];
            for (int i = 0; i < length; ++i)
            {
                buffer[i] = torrentStream[index++];
                //builder.Append(GetCurrentCharMove());
            }

            return buffer;
        }