code: private static final int nextSpaceIndex(StringBuffer sb, int seek, int lastIndex) {
      seek++;
      char c;
      while (seek < lastIndex) {
        c = sb.charAt(seek);
        if (c == ' ' || c == '\n') {
          while (sb.length() > seek + 1 && sb.charAt(seek + 1) == ' ')
            seek++;
          return seek;
        }
        seek++;
      }
      return lastIndex;
    }
docs: Finds the index of the nearest space after a specified index.
  
  @param sb The string buffer which contains the text being examined.
  @param seek The index to begin searching from.
  @param lastIndex The highest index of the StringBuffer sb.
  @return The index which contains the nearest space.