Java tutorial
import java.io.ByteArrayInputStream; public class Main { public static void main(String[] argv) throws Exception { byte[] bytes = "asdf".getBytes("UTF8"); new ByteArrayInputStream(bytes); } }