为什么我按照老师的写的代码输出的是这个样子?
public static void printHexByByteArray(String fileName)throws IOException{ FileInputStream in = new FileInputStream(fileName); byte[] buf = new byte[20*1024]; int bytes = in.read(buf, 0, buf.length); int j = 1; for(int i=0;i<bytes;i++){ if(buf[i]<=0xf){ System.out.print("0"); } System.out.print(Integer.toHexString(buf[i])+" "); if(j++%10==0){ System.out.println(); } } }
0ffffffca 0fffffffe 0ffffffba 0ffffffbe 00 00 00 34 00 34