1 import java.io.*;
 2 import org.apache.hadoop.conf.Configuration;
 3 import org.apache.hadoop.fs.*;
 4 
 5 public class C_ReadFile {
 6     public static void main(String[] args) {
 7         try {
 8             Var_init var = new Var_init();
 9             var.in = var.fs.open(var.p_remoteFilePath);
10             BufferedReader d = new BufferedReader(new InputStreamReader(var.in));
11             String line;
12             while ((line = d.readLine()) != null) {
13                 System.out.println(line);
14             }
15             System.out.println("read successfully");
16         } catch (Exception e) {
17             e.printStackTrace();
18         }
19     }
20 }
View Code

相关文章:

  • 2021-11-12
  • 2022-12-23
  • 2021-11-11
  • 2021-06-05
  • 2022-12-23
  • 2021-08-17
  • 2022-02-10
  • 2022-01-31
猜你喜欢
  • 2022-03-03
  • 2022-12-23
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
相关资源
相似解决方案