I need to write strings into ByteArrayOutputStream
, but I need to write strings with breaking. I have tried to do it as example:
out.write("123".getBytes());
out.write("\n456".getBytes());
But '\n' doesn't work. Please, tell me, how can I fix it? Or suggest me alternative OutputStream for storing strings (this OS must allow to use breaking of lines) without making files. Thank you.