Java: Convert String to InputStream

 


    // String -> InputStream
    private static InputStream convertStringToInputStream(String name) {

        InputStream result = new ByteArrayInputStream(name.getBytes(StandardCharsets.UTF_8));
        return result;

    }