public static InputStream stringToStream(String s){
  return new ByteArrayInputStream(s.getBytes(StandardCharsets.UTF_8));
}

public static InputStream stringToStream ( String s ) { return new ByteArrayInputStream ( s . getBytes ( StandardCharsets . UTF_8 ) ) ; }
converts a string to an input stream
