Don't add a newline after every output line. Instead, insert a a newLine before every line after the first line.
For example, you can replace your while
loop with the following code:
boolean needsNewLine = false;
while((currentLine = reader.readLine()) != null) {
if(currentLine.equals("")) continue;
if (!needsNewLine) {
needsNewLine = true;
} else {
writer.append('\n');
}
writer.append(currentLine);
}