Possible Duplicate:
Compare the content of 2 text files in java language
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
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);
}