首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java相关 >

请教 InputStream 中的 read() 方法返回的整数是什么

2012-04-01 
请问InputStream 中的read() 方法返回的整数是什么?temp 的整数值是什么?是字符的什么码?Java codeimport

请问 InputStream 中的 read() 方法返回的整数是什么?
temp 的整数值是什么?是字符的什么码?

Java code
import java.io.*;public class Iojava {    public static void main(String[] args) throws Exception {    File f=new File("D:"+File.separator+"text.txt");    InputStream In=null;    In=new FileInputStream(f);    byte[] b=new byte[1024];    int temp=0;    int len=0;    while((temp=In.read())!=-1)    {        System.out.print("temp 的值为:"+temp);        len++;        System.out.println("   len的值为"+len);            }    In.close();    }}

结果:

temp 的值为:196 len的值为1
temp 的值为:227 len的值为2
temp 的值为:186 len的值为3
temp 的值为:195 len的值为4

[解决办法]
unicode码的10进制数

热点排行