I am trying to read the contents of a text file and write to another file. The thing is I want to read the file every 1sec. Here is what I have tried.
void setData() {
      System.out.println("inside setdata");
      String line = null;
      String file = "E:/sss.txt";
      FileInputStream fis = null;
      String text = null;
      try{
             ....
     while(true) {
       byte bt[] = new byte[(int) file.length()];
        fis.read(bt);
        text = new String(bt);
        System.out.println( text);
        fis.close();  
        line = text + line;
        while(text != null) {
        Thread.sleep(2000);
        System.out.println(line);
        }     
      }
     }catch (Exception e){
            }
    }
Where am I wrong here?
What Iget is
inside setdata
inside try
http://www.
http://www.null
http://www.null
http://www.null
going on and on Thanks in advance
 
    