code: public static Value parse(File file) throws JSONException {
  		InputStream input = null;
  		try {
  			byte[] header = new byte[4];
  			
  			// Guess charset
  			input = new FileInputStream(file);
  			input.read(header);			
  			Charset charset;
  			if (header[0] == 0) {
  				charset = (header[1] == 0 ? UTF32BE : UTF16BE);
  			}
  			else if (header[1] == 0) {
  				charset = (header[2] == 0 ? UTF32LE : UTF16LE);
  			}
  			else {
  				charset = UTF8;
  			}
  			input.close();
  			input = null;
  			
  			// Parse the whole file
  			return parse(file, charset);
  		}
  		catch (IOException e) {
  			throw new JSONException(e);
  		}
  		finally {
  			if (input != null) {
  				try {
  					input.close();
  				}
  				catch (IOException e) {
  				}
  			}
  		}
  	}
docs: Parses JSON data from a file.
  
  The character set of the file is auto-detected.
  The file will be opened 2 times (once for detecting the character set, and once
  for the actual parsing)
  
  @param file the file to read the data from
  @return the parsed JSON Value.
  @throws JSONException