I am using this piece of code:
String v="bla";
Charset charset = Charset.forName("UTF-8");
CharsetEncoder encoder = charset.newEncoder();
ByteBuffer updated =encoder.encode(CharBuffer.wrap(v+"albalb"));
The casting works fine, and I succeeded to print this ByteBuffer
to a file that located in my cloud. Now, I want a new line after v is printed to the file. I've tried those things:
\r\n
\n
public static String newline = System.getProperty("line.separator");
None of them worked for me. Anyone has idea?
The following code seems to work fine for me.
Maybe the error lies somewhere else?
EDIT with regards to comment.