Java tutorial
import java.io.CharArrayWriter; public class Main { public static void main(String[] args) throws Exception { String str = "from java2s.com!"; CharArrayWriter chw = new CharArrayWriter(100); chw.write(str); System.out.println(chw.toString()); } }