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();
}
}
}
相关分类