title: Cannot parse jsonobject----"A JSONObject text must begin with '{' at character 1 of "
body: <pre><code>String json = "{'name': 'Tom','array':[{'a':'111','b':'222','c':'333'},{},{'a':'999'}],'address':'York'}";
  
  try {
      JSONObject jsonObject = JSONObject.fromObject(json);
      String name = jsonObject.getString("name");
      String address = jsonObject.getString("address");
      System.out.println("name is:" + name);
      System.out.println("address is:" + address);
      JSONArray jsonArray = jsonObject.getJSONArray("array");
      for (int i = 0; i &lt; jsonArray.size(); i++) {
          System.out.println("item " + i + " :" + jsonArray.getString(i));
      }
  } catch (JSONException e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>Eveything is OK.
  But when I put <code>{'name': 'Tom','array':[{'a':'111','b':'222','c':'333'},{},{'a':'999'}],'address':'York'}</code> into a file.</p>
  
  <pre><code>        File file = new File(fileName);  
          BufferedReader reader = null;           
          try {  
              reader = new BufferedReader(new FileReader(file));  
              String tempString = null;  
              while ((tempString = reader.readLine()) != null){                   
                  JSONObject jo = JSONObject.fromObject(tempString.trim());
                  String id = jo.getString("id");
                  String name = jo.getString("name");
                  log.info(id + ":" + name);
              }  
              reader.close();  
          } catch (IOException e) {  
              e.printStackTrace();  
          } 
  </code></pre>
  
  <p>It tells me <code>Exception in thread "main" net.sf.json.JSONException: A JSONObject text must begin with '{' at character 1 of "{'name': 'Tom','array':[{'a':'111','b':'222','c':'333'},{},{'a':'999'}],'address':'York'}</code>. What's the problem in this code? Can any figure it out for me? Thanks.</p>
  
  <p>my file:</p>
  
  <p><code>{'name': 'Tom','array':[{'a':'111','b':'222','c':'333'},{},{'a':'999'}],'address':'York'}</code></p>