new line for every new stream in SequenceInputStream

Viewed 920

I have two files, test-1.text (content is Data from test-1) and test-2.text (content is Data from test-2).
when I use SequenceInputStream to read from two streams, output comes either in one straight line like Data from test-1Data from test-2 or every character is on new line.
How can I start to print content from the second stream in a new line?

public class SequenceIStream {

public static void main(String[] args) throws IOException {
    FileInputStream fi1 = new FileInputStream("resources/test-1.text");
    FileInputStream fi2 = new FileInputStream("resources/test-2.text");

    SequenceInputStream seq = new SequenceInputStream(fi1, fi2);

    int i= 0;

    while((i = seq.read())!=-1)
        System.out.print((char)i);
}

}

Output is
Data from test-1Data from test-2

Desired output
Data from test-1
Data from test-2

2 Answers
Related