Consider 1000 files in the folder.Now i want to find the same file in that folder.
I tired it by byte by byte comparison but it took long time to finish. This is the code
fs1=new BufferedInputStream(new FileInputStream(file1));
fs2=new BufferedInputStream(new FileInputStream(file2));
int b1,b2;
do
{
b1=fs1.read();
b2=fs2.read();
if(b1!=b2)
{
match=false;
break;
}
}while(found && b1 !=- 1);
if(match)
{
Log.e("cyb", "Matched");
}
Any other method to find the same file?