title: Able to parse RSS feed file in Java project, unable in Android
body: <p>I have a Java Project in Eclipse where I download the CNN technology RSS <a href="http://rss.cnn.com/rss/cnn_tech.rss" rel="nofollow">feed</a>, then use SAX to parse and get the number of items in the feed.</p>
  
  <pre><code>//download file
  URL url = new URL(address);
  InputStream is = url.openStream();
  FileOutputStream fos = new FileOutputStream("newsfeed.xml");
  
  byte[] buffer = new byte[1024];
  int bytesRead = is.read(buffer);
  while (bytesRead != -1) {
      fos.write(buffer, 0, bytesRead);
      bytesRead = is.read(buffer);
  }
  
  fos.close();
  is.close();
  
  //read file
  SAXParserFactory factory = SAXParserFactory.newInstance();
  SAXParser parser = factory.newSAXParser();
  XMLReader reader = parser.getXMLReader();
  
  RSSHandler handler = new RSSHandler();
  reader.setContentHandler(handler);
  
  FileInputStream fis = new FileInputStream("newsfeed.xml");
  InputSource is = new InputSource(fis);
  reader.parse(is);
  </code></pre>
  
  <p>However when I take this code in Android, I get a Parser Exception on the line</p>
  
  <pre><code>reader.parse(is);
  </code></pre>
  
  <p>The only code I change in Android is</p>
  
  <pre><code>//download file
  FileOutputStream out = context.openFileOutput(FILE_PATH, Context.MODE_PRIVATE);
  
  //read file
  FileInputStream stream = context.openFileInput(FILE_PATH);
  </code></pre>
  
  <p>any idea why this happens? or how to fix it?</p>
  
  <p>The exact error I get is a SAXException with the message "At line 1, column 0: not well-formed (invalid token)"</p>