直接看代码
1 public static void saveStreamToFile(String savePath,String input){
2       try {
3             //savePath like c:/log.txt
4             System.setOut(new PrintStream(new FileOutputStream(savePath)));
5             System.out.println(input);
6       } catch (FileNotFoundException e) {
7             e.printStackTrace();
8      }
9 }
View Code

相关文章:

  • 2021-08-13
  • 2021-07-14
  • 2022-01-17
  • 2021-12-15
猜你喜欢
  • 2021-07-10
  • 2021-10-23
  • 2021-06-23
  • 2022-12-23
  • 2021-11-03
  • 2022-12-23
  • 2021-06-23
相关资源
相似解决方案