Java examples for File Path IO:File Stream
Convert String to InputStream
import java.io.ByteArrayInputStream; import java.io.InputStream; public class Main { public static void main(String args[]){ String str1 = "this is a test"; byte[] bytes = str1.getBytes(); //from www .ja va 2 s . c om InputStream inputStream = new ByteArrayInputStream(bytes); } }