Some methods want an InputStream, converting a String into an InputStream is very easy:
/**
* Converts a string into an inputstream
* @param s
* @return
*/
private InputStream convertStringToInputStream(String s) {
ByteArrayInputStream in = new ByteArrayInputStream(s.getBytes());
return in;
}