title: String comparison of text files
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1510520/compare-the-content-of-2-text-files-in-java-language">Compare the content of 2 text files in java language</a>  </p>
  </blockquote>
  
  
  
  <p>I am trying to compare strings of two .txt files in an android application. can you please tell me how to proceed??
  i want to insert the code in this</p>
  
  <pre><code>try {
       URL url = new URL("httpurl");                             
       URLConnection ucon = url.openConnection();
       InputStream is = ucon.getInputStream();
       BufferedInputStream bis = new BufferedInputStream(is);
       ByteArrayBuffer baf = new ByteArrayBuffer(50);
       int current = 0;
       while ((current = bis.read()) != -1) {
             baf.append((byte) current);
       }
  
       FileOutputStream fos = new FileOutputStream("/mnt/sdcard/random.txt");
       fos.write(baf.toByteArray());
       fos.close();
  } catch (IOException e) {
       Log.d("ImageManager", "Error: " + e);
  }
  </code></pre>