buffered.java

来自「JAVA 2应用开发指南」· Java 代码 · 共 22 行

JAVA
22
字号
//Buffered.java
import java.io.*;
import java.util.*;
public class Buffered {
   public static void main(String[] args) {
      InputStream is;
      int ch;
      System.out.println("Start! " + new Date());
      try {
         is = new BufferedInputStream(new FileInputStream(args[0]));
         while ((ch=is.read()) != -1) {
         // read entire file
         }
      }
      catch (IOException io) {
         System.out.println(io);
         System.exit(-1);
      }
         System.out.println("Stop! " + new Date());
   }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?