Convert java.io.StringWriter to byte[] array

Adeeb Cheulkar :

How to convert java.io.StringWriter to byte[] array? Using OpenCSV i get StringWriter sw object and this sw object I want to convert into byte[] array.

Peter Lawrey :

You can do

byte[] bytes = stringWriter.toString().getBytes("UTF-8");

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related