Get InputStream from a String : String Convert « Data Type « Java
- Java
- Data Type
- String Convert
Get InputStream from a String
import java.io.ByteArrayInputStream;
public class Main {
public static void main(String[] argv) throws Exception {
byte[] bytes = "asdf".getBytes("UTF8");
new ByteArrayInputStream(bytes);
}
}
Related examples in the same category