Fixed a bug when the string we were looking for in the byte[] or char[] was longer than the remaining bytes or chars (from the given index). An ArrayOutOfBoundsException was thrown then.

git-svn-id: https://svn.apache.org/repos/asf/directory/shared/trunk@1449694 13f79535-47bb-0310-9956-ffa450edef68