code: private static int copyPathFragment(char[] input, int beginIndex, StringBuilder output)
  	{
  		int inputCharIndex = beginIndex;
  		while (inputCharIndex < input.length)
  		{
  			final char inputChar = input[inputCharIndex];
  			if (inputChar == '/')
  			{
  				break;
  			}
  
  			output.append(inputChar);
  			inputCharIndex += 1;
  		}
  
  		return inputCharIndex;
  	}
docs: Copy path fragment
  
  @param input
  input string
  @param beginIndex
  character index from which we look for '/' in input
  @param output
  where path fragments are appended
  @return last character in fragment + 1