为了账号安全,请及时绑定邮箱和手机立即绑定

不明白 数组B是怎么读取到内容的?

不明白 数组B是怎么读取到内容的?

weibo_快乐is魏帆_0 2016-07-14 11:07:00
public void Text2() throws IOException{    long start = System.currentTimeMillis();    FileInputStream file = new FileInputStream("D:\\Text\\遍历目录\\FileTest.java");    byte[] b = new byte[20*1024];    int bytes = file.read(b,0,b.length);    int a = 1;    for(int i=0; i<bytes; i++){      if(b[i] <= 0xf)        System.out.print(0);      System.out.print(Integer.toHexString(b[i])+" ");      if(a++ % 10 == 0)       System.out.println();    }
查看完整描述

3 回答

?
损失函数

TA贡献114条经验 获得超93个赞

通过文件输入流的read方法,你可以具体查下read方法的api

查看完整回答
1 反对 回复 2016-07-14
  • 3 回答
  • 0 关注
  • 1352 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信