String str = "";//add your string content InputStream inputStream = new ByteArrayInputStream(str.getBytes());