...
while((textline = buffer.readLine()) !=null)
System.out.println(textline);
if (textline.equals("William")) System.out.println("xxxxxx");
...
You should write those lines like this. I guess you will notice the difference.
...
while((textline = buffer.readLine()) !=null)
{
System.out.println(textline);
if (textline.equals("William")) System.out.println("xxxxxx");
}
...