code: public String next(int n) throws JSONException {
  
          if (n == 0) {
              return "";
          }
  
          char[] buffer = new char[n];
          int pos = 0;
  
          if (m_useLastChar) {
              m_useLastChar = false;
              buffer[0] = m_lastChar;
              pos = 1;
          }
  
          try {
              int len = m_reader.read(buffer, pos, n - pos);
              while ((pos < n) && (len != -1)) {
                  pos += len;
                  len = m_reader.read(buffer, pos, n - pos);
              }
          } catch (IOException exc) {
              throw new JSONException(exc);
          }
          m_index += pos;
  
          if (pos < n) {
              throw syntaxError("Substring bounds error");
          }
  
          m_lastChar = buffer[n - 1];
          return new String(buffer);
      }
docs: Get the next n characters.<p>
  
  @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