Git.Core.Object.ParseString C# (CSharp) Method

ParseString() protected static method

protected static ParseString ( byte input, int &pos, string &str ) : bool
input byte
pos int
str string
return bool
        protected static bool ParseString(byte[] input, ref int pos, out string str)
        {
            int index = pos;
            str = null;

            if (input.Length == pos)
                return false;

            while ((input[index] != (byte)'\n') && (input[index] != (byte)0))
            {
                if (index < input.Length) {
                    index++;
                } else {
                    return false;
                }
            }

            int length = index - pos;
            if (length == 0)
            {
                return false;
            }

            str = Encoding.UTF8.GetString (input, pos, length);
            pos = index;

             			return true;
        }