BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new ByteArrayOutputStream(), encoding));
public void write(final List<Column> columnsList) throws IOException {
String data = null;
int length = columnsList.size();
int writeIndex = 0;
for (Column cd : columnsList) {
data = cd.getData();
writer.write(data);
writer.write(getDelimiter()); // it will return '\t'
}
writer.write("\n");
}
The above code is not placing the tab space in file, and in actual it writes \t
in file.
When I write the file with hard coded "\t", it really does write tab space. But I am receiving the "\t" delimiter from web-end.
I am just picking this delimiter and writing with writer. But when I open the file in notepad, "\t" is actually written in the file instead of TAB SPACE
I am closing the writer in other method., so no worry about closing the writer