惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
Jina AI
Jina AI
H
Help Net Security
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
L
LangChain Blog
Recorded Future
Recorded Future
F
Full Disclosure
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
GbyAI
GbyAI
B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
M
MIT News - Artificial intelligence
爱范儿
爱范儿
V
V2EX
Microsoft Azure Blog
Microsoft Azure Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Y
Y Combinator Blog
B
Blog
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
W
WeLiveSecurity
MongoDB | Blog
MongoDB | Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
The Cloudflare Blog
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
D
DataBreaches.Net
博客园 - 【当耐特】
T
Troy Hunt's Blog
V
Visual Studio Blog
V2EX - 技术
V2EX - 技术
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google Online Security Blog
Google Online Security Blog
The GitHub Blog
The GitHub Blog

博客园 - jingleguo

[zz]软件测试专业术语 word分栏时脚注强制分页问题解决 安装JDK和TOMCAT并配置环境变量的过程 - jingleguo - 博客园 Thinkpad鼠标在Chrome中无法使用滚轮 [zz]第五套人民币发行冠号 SourceForge镜像 How Can You Buy or Sell The Sky?[zz] Python设置默认语言编码 china-pub返回的错误网页 - jingleguo - 博客园 X61 T61 休眠后自动重启与耗电问题 自题 'You've got to find what you love,' Jobs says 使用VC向Windows发送消息代码示例 百度千万别做邮箱 察传 赋得自君之出矣 用逻辑来骗MM和在论坛上骗钱 Google 的午餐 集句
Java使用Scream流读入并输出文件示例
jingleguo · 2007-05-09 · via 博客园 - jingleguo

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class ReadAndPrint {
    
public static final int BUFSIZE = 1024;

    
public static void main(String[] args) {
        
byte[] buffer = new byte[BUFSIZE]; // 定义一byte类型的缓冲区。
        FileInputStream fin = null;

        
boolean flag = true;
        
try {
            fin 
= new FileInputStream("c://test.ini");
        }
 catch (FileNotFoundException e) {
            e.printStackTrace();
        }

        
while (flag) {
            
try {
                
int nn = fin.read(buffer);
                System.out.write(buffer, 
0, nn);
            }
 catch (Exception e) {
                flag 
= false;
            }

        }

    }

}

posted on 2007-05-09 18:11  jingleguo  阅读(829)  评论(0)    收藏  举报

刷新页面返回顶部