Could someone please explain why the two code snippets create such different results?

CODE 1:
FileInputStream stream = new FileInputStream("C:\\testfile.txt");
InputStreamReader reader = new InputStreamReader(stream);
StreamTokenizer tokens = new StreamTokenizer(reader);

res.setContentType("text/html");
PrintWriter out = res.getWriter();
String temp_string = "";
while (tokens.nextToken() != tokens.TT_EOF) {
temp_string = tokens.sval;
out.println(temp_string);
}


CODE 2:
FileInputStream stream = new FileInputStream("C:\\testfile.txt");
InputStreamReader reader = new InputStreamReader(stream);
StreamTokenizer tokens = new StreamTokenizer(reader);

res.setContentType("text/html");
PrintWriter out = res.getWriter();
String temp_string = "";
while (tokens.nextToken() != tokens.TT_EOF) {
temp_string += tokens.sval;
}
out.println(temp_string);


In the second example, no white space from the input file is passed to temp_string.
In the first example, single-space characters are passed, but line breaks are not.

I'm guessing I need to read in something other than "sval" for whitespace characters, and I can figure that out probably, but I have no idea why the two examples wouldn't produce the same result.

Thanks in advance for your help.