import java.io.*;public class Text{? public static void main(String[] args){? ? try{? ? ? FileInputStream file = new FileInputStream("D:\\Text\\遍歷目錄\\FileTest.java");? ? ? int b;? ? ? int a = 1;? ? ? while((b=(int)file.read())!= -1){? ? ? ? if( b <= 0xf){? ? ? ? ?System.out.print(0);? ? ? ? }? ? ? ? System.out.print(Integer.toHexString(b)+" ?");? ? ? ? if(a++ % 10 == 0)? ? ? ? ? System.out.println();? ? ? }? ? ? file.close();? ? ?}catch(IOException e){? ? ? ? e.printStackTrace();? ? ?}? ? ??? }}
不明白 b<=0xF 的意思
weibo_快樂is魏帆_0
2016-07-14 10:44:43