code: public static int getNextSequence(
          char[] array,
          int pos,
          char[] delimiter,
          StringBuffer buf)
      {
          buf.delete(0, buf.length());
          char quot = 0;
          for (; pos < array.length; pos++) {
              char ch = array[pos];
              if (quot != 0) {
                  if (ch == quot) {
                      quot = 0;
                  }
              } else {
                  if (ch == '\"') {
                      quot = ch;
                  } else {
                      // Checks if a new delimiter sequence was found in the
                      // current position
                      int i = skipSequence(array, pos, delimiter);
                      if (i > pos) {
                          pos = i;
                          break;
                      }
                  }
              }
              buf.append(ch);
          }
          return pos;
      }
docs: This method copies to the given buffer all characters from the specified
  position of the character array to the next delimiter position. This
  method returns the next position just after the delimiter (or the length
  of the array if no delimiters was found).
  
  @param array the array of character used as a source of chars
  @param pos the start position in the array
  @param delimiter the delimiter; this method copies all character from the
  current position to the first delimiter sequence
  @param buf the buffer where the content should be appended
  @return the next position just after the delimiter of the end of the
  sequence