2012-07-14 6 views

答えて

1

私は解決策を見つけた

byte[] bytes = Files.readAllBytes(Paths.get("text.txt")); 
    String text = new String(bytes, StandardCharsets.UTF_8); 
3

BufferedReader reader = new BufferedReader(new InputStreamReader(new BufferedInputStream(new FileInputStream(new File("text.txt"))))); 

    String line = null; 

    while ((line = reader.readLine()) != null) { 
     // do something with your read line 
    } 

か、この1:ここでは

FileInputStream fs = new FileInputStream(f); 
関連する問題