redirecting.java.svn-base

来自「·TFTPUtil ReadMe For additions, changes,」· SVN-BASE 代码 · 共 27 行

SVN-BASE
27
字号
import java.io.*;
public class Redirecting {
  // Throw exceptions to console:
  public static void main(String[] args)
  throws IOException {
    PrintStream console = System.out;
    BufferedInputStream in = new BufferedInputStream(
      new FileInputStream("Redirecting.java"));

    PrintStream out = new PrintStream(
      new BufferedOutputStream(
        new FileOutputStream("test.out")));

    System.setIn(in);
    System.setOut(out);
    System.setErr(out);

    BufferedReader br = new BufferedReader(
      new InputStreamReader(System.in));
    String s;
    while((s = br.readLine()) != null)
      System.out.println(s);
    out.close(); // Remember this!
    System.setOut(console);
  }
}

⌨️ 快捷键说明

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