爪哇。伊奥。InputStream类是表示字节输入流的所有类的超类。如何读取包含字符的文件?
我有一个名为mark_method.json
的文件,其中包含ABCDE
,我正在使用InputStream
{
根据定义,InputStream
{
我试图理解读取字节的流是如何从文件中读取字符的
public class MarkDemo {
public static void main(String args[]) throws Exception {
InputStream is = null;
try {
is = new FileInputStream("C:\\Users\\s\\Documents\\EB\\EB_02_09_2020_with_page_number_and_quote_number\\Old_images\\mark_method.json");
}
catch(Exception e) {
e.printStackTrace();
} finally {
if(is != null) {
is.close();
}
}
}
}
共 (0) 个答案