code: public String next(int n) throws JSONException {
           if (n == 0) {
               return "";
           }
  
           char[] buffer = new char[n];
           int pos = 0;
  
           while (pos < n) {
               buffer[pos] = next();
               if (end()) {
                   throw syntaxError("Substring bounds error");                 
               }
               pos += 1;
           }
           return new String(buffer);
       }
docs: Get the next n characters.
  
  @param n     The number of characters to take.
  @return      A string of n characters.
  @throws JSONException
  Substring bounds error if there are not
  n characters remaining in the source string.