Synced the behavior of startsWith and endsWith, because some old compilers like Borland C++ Builder 5 could throw out_of_range exceptions if prefix was larger than the source string and we can short circuit the comparison in that case anyways.
Synced the behavior of startsWith and endsWith, because some old compilers like Borland C++ Builder 5 could throw out_of_range exceptions if prefix was larger than the source string and we can short circuit the comparison in that case anyways.

git-svn-id: 0ddeb4c3d582cc869847f86e9e2097d0947b0a11@1559531 13f79535-47bb-0310-9956-ffa450edef68

wuhao5/log4cxx,wuhao5/log4cxx,wuhao5/log4cxx,wuhao5/log4cxx