67,513
社区成员
发帖
与我相关
我的任务
分享
try {
FileInputStream file = new FileInputStream("d:/a.txt");
int b = file.read();
String s = null;
while(b!=-1) {
s = String.format("%1$8s", Integer.toBinaryString(b)).replaceAll(" ", "0");
System.out.printf(s+" ");
b = file.read();
}
} catch (Exception e) {
e.printStackTrace();
}