public static InputStream toInputStream(final String input,final Charset encoding){
  return new ByteArrayInputStream(input.getBytes(Charsets.toCharset(encoding)));
}

public static InputStream toInputStream ( final String input , final Charset encoding ) { return new ByteArrayInputStream ( input . getBytes ( Charsets . toCharset ( encoding ) ) ) ; }
convert the specified string to an input stream , encoded as bytes using the specified character encoding .
