try
{
    FileInputStream in=new FileInputStream(f);
    byte [] buf=new byt[1024];
    int len=in.read(buf);
    System.out.pintln(new String(buf,0,len));
}
catch(Exception e)
{
    System.out.println(e.getMessage());
}