package stream;

import java.io.*;

public class InputStreamReaderString {

    public static void main(String[] args)  {

        File f = new File("src/stream","hello.txt");
        
        try(FileInputStream fis = new FileInputStream(f)){
            
            byte[] all = new byte[(int)f.length()];
            
            fis.read(all);
            
            String str = new String(all);
            
            System.out.println(str);
            
        }catch(IOException e) {
            e.printStackTrace();
        }
        
    }

}

 

相关文章:

  • 2021-09-09
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
猜你喜欢
  • 2022-03-01
  • 2021-11-20
  • 2021-06-19
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案