今天爱分享给大家带来读取一个文件在控制台打印出来【面试题详解】,希望能够帮助到大家。
File file = new File("E:\\JRadioButtonDemo.java");
long file_length= file.length();
try {
//输入流
FileInputStream input = new FileInputStream(file);
byte b_data [] = new byte[(int)file_length];
input.read(b_data);
System.out.println(new String(b_data));
input.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
原文链接:http://blog.itblood.com/3604.html,转载请注明出处。

![【调教互动SLG/中文/动态】堕落精灵·芙蕾雅V1.1.1 官方中文步兵正式版[更新]【电脑/1.1G】](/wp-content/uploads/replace/2025/11/02/4873da2d2271ba36ccd4103333c6deaf.webp)