import java.io.FileInputStream;
import java.io.IOException;
public class IOUtile {
/**
<span style="white-space:pre"> </span> * 单字节读取
* 读取指定文件内容,然后以16进制输出到控制台
* 每读10个换行
* @param file
* @throws IOException
*/
public static void Hex(String file) throws IOException{
FileInputStream in = new FileInputStream(file);
int b;
int i =1;
while((b = in.read()) != -1){//读到-1文件结束
if(b <= 0xf)
System.out.print(0 + "");
System.out.print(Integer.toHexString(b)+ " ");
if(i++ % 10 == 0)//每10个换行
System.out.println();
}
}
}