- package ThreeBook.demo.homework.homework3_3;
- import java.io.*;
- public class Text4 {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- File file = new File("C:/Windows/win.ini");
- FileInputStream inputStream = null;
- DataInputStream inputStream2 = null;
- try {
- inputStream = new FileInputStream(file);
- inputStream2 = new DataInputStream(inputStream);
- int temp = 0;
- while ((temp = inputStream2.read()) != -1) {
- System.out.print(temp+" ");
- }
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }finally {
- try {
- inputStream2.close();
- inputStream.close();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
05-20
282
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)