public static InputStream toUTF8InputStream(String str){
  InputStream is=null;
  try {
    is=new ByteArrayInputStream(str.getBytes("UTF-8"));
  }
 catch (  UnsupportedEncodingException e) {
    throw new AssertionError();
  }
  return is;
}

public static InputStream toUTF8InputStream ( String str ) { InputStream is = null ; try { is = new ByteArrayInputStream ( str . getBytes ( "UTF-8" ) ) ; } catch ( UnsupportedEncodingException e ) { throw new AssertionError ( ) ; } return is ; }
replacement for deprecated stringbufferinputstream ( ) . instead of : inputstream is = new stringbuilderinputstream ( str ) ; do : inputstream is = stringutil . toutf8inputstream ( str ) ;
