Following code snippet show how to $subject.
import java.io.UnsupportedEncodingException;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
public class StringSample {
public static void main(String[] args) {
String textInput = "Convert String to InputStream";
try {
InputStream is = new ByteArrayInputStream(textInput.getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
}
No comments:
Post a Comment