如何逐字节读取字节输入流中的数据?
- 内容介绍
- 文章标签
- 相关推荐
本文共计146个文字,预计阅读时间需要1分钟。
javaimport java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;
public class Test3 { public static void main(String[] args) { try (FileInputStream fileInputStream=new FileInputStream(a.txt)) { // 读取文件内容 } catch (FileNotFoundException e) { System.out.println(文件未找到); } catch (IOException e) { System.out.println(读取文件时发生错误); } }}
本文共计146个文字,预计阅读时间需要1分钟。
javaimport java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;
public class Test3 { public static void main(String[] args) { try (FileInputStream fileInputStream=new FileInputStream(a.txt)) { // 读取文件内容 } catch (FileNotFoundException e) { System.out.println(文件未找到); } catch (IOException e) { System.out.println(读取文件时发生错误); } }}

