Mega Code Archive

 
Categories / Java Tutorial / Data Type
 

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);   } }