Alternative to java.nio.file.Files in Java 6

前端 未结 5 1753
北荒
北荒 2021-01-18 17:33

I have the following piece of code that uses the java 7 features like java.nio.file.Files and java.nio.file.Paths

import java.io.File;
impor         


        
5条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-18 18:11

    If you really don't want to use FileReader(Though I didn't understand why) you can go for FileInputStream.

    Syntax:

    InputStream inputStream = new FileInputStream(Path of your file);
    Reader reader = new InputStreamReader(inputStream);
    

提交回复
热议问题