code: public String next(int n) throws JSONException {
           if (n == 0) {
               return "";
           }
  
           char[] buffer = new char[n];
           int pos = 0;
  
           if (this.useLastChar) {
          	 this.useLastChar = false;
               buffer[0] = this.lastChar;
               pos = 1;
           }
  
           try {
               int len;
               while ((pos < n) && ((len = reader.read(buffer, pos, n - pos)) != -1)) {
                   pos += len;
               }
           } catch (IOException exc) {
               throw new JSONException(exc);
           }
           this.index += pos;
  
           if (pos < n) {
               throw syntaxError("Substring bounds error");
           }
  
           this.lastChar = buffer[n - 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.