File file=new File("C:\\Users\\ju\\Desktop\\writeIn\\My.txt");
byte[] b=new byte[(int)file.length()];
FileInputStream input=new FileInputStream(file);
input.read(b);
for(int i=0;i<b.length;i++)
{
System.out.println(b[i]);
}
String a=new String(b);
System.out.println(a);
File ff = new File("d:\\temp\\newread2.txt");
FileOutputStream fos = new FileOutputStream(ff);
fos.write(b);
input.close();
fos.close();
----------------------------------------------------
for(int i=0;i<b.length;i++)
{
System.out.println(b[i]);
}
String a=new String(b);
System.out.println(a);
这么一下为什么就把文件(My.txt)里的数据打印到控制台了, byte[] b=new byte[(int)file.length()];好像只是在说byte数组的长度大小吧!