import java.io.ByteArrayInputStream;
import java.io.InputStream;
String 聽 str 聽 = 聽 "";//add 聽 your 聽 string 聽 content
InputStream 聽 inputStream 聽 = 聽 new 聽 ByteArrayInputStream(str.getBytes());
2. String鍜屾暟瀛椾簰鐩歌漿鎹?/strong>
1 濡備綍灝嗗瓧涓?String 杞崲鎴愭暣鏁?int?
聽 鏈変袱涓柟娉?
聽 1). int i = Integer.parseInt([String]); 鎴?
聽聽聽聽聽 i = Integer.parseInt([String],[int radix]);
聽 2). int i = Integer.valueOf(my_str).intValue();
聽 娉? 瀛椾覆杞垚 Double, Float, Long 鐨勬柟娉曞ぇ鍚屽皬寮?
2 濡備綍灝嗘暣鏁?int 杞崲鎴愬瓧涓?String ?
聽 1.) String s = String.valueOf(i);
聽 2.) String s = Integer.toString(i);
聽 3.) String s = "" + i;
聽 娉? Double, Float, Long 杞垚瀛椾覆鐨勬柟娉曞ぇ鍚屽皬寮?