Thanks @Topaco
It was due to Carriage Return. Carriage return means to return to the beginning of the current line without advancing downward. The name comes from a printer's carriage, as monitors were rare when the name was coined. This is commonly escaped as "\r", abbreviated CR, and has ASCII value 13 or 0x0D.
Which in turn starts the things from the beginning of line skipping all the contents which is concatenated or is about to print and then prints the next characters from there. When the byte array will have 13 in it the carriage return will happen