Remove new line when using printwriter
<p>I am trying to print out any changes that is appended at the end of a log file, similar to tail log. But when printing it out with printwriter it will also print out a new line. 
Instead of printing</p>

<pre><code>test1 
test2
</code></pre>

<p>it prints:</p>

<pre><code>test1

test2
</code></pre>

<p>Code is as below. I tried with pwriter.print(line) instead of println but nothing is printed. Is there any way to remove the carriage return.</p>

<pre><code>public class Lognow implements Runnable{
boolean execute = true;

InputStreamReader inputStreamReader;
BufferedReader bufferedReader;
PrintWriter pwriter;

public Lognow(){
PrintWriter pw = new PrintWriter(System.out, true);
try {

     inputStreamReader = new InputStreamReader(new FileInputStream ("D:/app/logi.txt"));
     bufferedReader = new BufferedReader (inputStreamReader);
     String line = bufferedReader.readLine();
     while(line!=null){          
         line = bufferedReader.readLine();
     }

     pwriter = pw;

} catch (FileNotFoundException e) {
    e.printStackTrace();
} catch (IOException e) {
    e.printStackTrace();
}
}

public void run() {
    while( execute ) {
        try {
            String str="";
            String line = bufferedReader.readLine();

            if(line!=null) {

                pwriter.println(line);

            }
            else {
                try {
                    Thread.sleep( 500 );
                }
                catch( InterruptedException ex )
                {
                    execute = false;
                }
            }


        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}

public static void main(String[] args){
    Lognow lognow = new Lognow();
    lognow.run();
}
</code></pre>
