public static void copy(String in,Charset charset,OutputStream out) throws IOException {
  Assert.notNull(in,"No input String specified");
  Assert.notNull(charset,"No charset specified");
  Assert.notNull(out,"No OutputStream specified");
  Writer writer=new OutputStreamWriter(out,charset);
  writer.write(in);
  writer.flush();
}

public static void copy ( String in , Charset charset , OutputStream out ) throws IOException { Assert . notNull ( in , "No input String specified" ) ; Assert . notNull ( charset , "No charset specified" ) ; Assert . notNull ( out , "No OutputStream specified" ) ; Writer writer = new OutputStreamWriter ( out , charset ) ; writer . write ( in ) ; writer . flush ( ) ; }
copy the contents of the given string to the given output outputstream . leaves the stream open when done .
