docs: public static JSONArtifact parse(Reader reader, boolean order) throws IOException, NullPointerException {
          if (reader != null) {
              PushbackReader pReader = null;
  
              //Determine if we should buffer-wrap the reader before passing it on
              //to the appropriate parser.
              boolean bufferIt = false;
  
              Class readerClass = reader.getClass();
  
              if (!StringReader.class.isAssignableFrom(readerClass) && 
                  !CharArrayReader.class.isAssignableFrom(readerClass) &&
                  !PushbackReader.class.isAssignableFrom(readerClass) &&
                  !BufferedReader.class.isAssignableFrom(readerClass)) {
                  bufferIt = true;
              }
  
              if (PushbackReader.class.isAssignableFrom(readerClass)) {
                  pReader = (PushbackReader) reader;
              } else {
                  pReader = new PushbackReader(reader);
              }
  
              Reader rdr = pReader;
              int ch = pReader.read();
              while (ch != -1) {
                  switch (ch) {
                      case '{':
                          pReader.unread(ch);
                          if (bufferIt) {
                              rdr = new BufferedReader(pReader);
                          }
                          if (order) {
                              return OrderedJSONObject.parse(rdr);
                          } else {
                              return JSONObject.parse(rdr);
                          }
                      case '[':
                          pReader.unread(ch);
                          if (bufferIt) {
                              rdr = new BufferedReader(pReader);
                          }
                          return JSONArray.parse(rdr);
                      case ' ':
                      case '\t':
                      case '\f':
                      case '\r':
                      case '\n':
                      case '\b':
                          ch = pReader.read();
                          break;
                      default:
                          throw new IOException("Unexpected character: [" + (char)ch + "] while scanning JSON String for JSON type.  Invalid JSON."); 
                  }
              }
              throw new IOException("Encountered end of stream before JSON data was read.  Invalid JSON");
          } else {
              throw new NullPointerException("reader cannot be null.");
          }
      }