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

推荐订阅源

博客园 - 【当耐特】
Help Net Security
Help Net Security
P
Proofpoint News Feed
J
Java Code Geeks
爱范儿
爱范儿
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
Google DeepMind News
Google DeepMind News
H
Help Net Security
G
Google Developers Blog
Jina AI
Jina AI
Vercel News
Vercel News
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
Lohrmann on Cybersecurity
S
Schneier on Security
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
Security Archives - TechRepublic
Security Archives - TechRepublic
阮一峰的网络日志
阮一峰的网络日志
N
News and Events Feed by Topic
GbyAI
GbyAI
B
Blog
O
OpenAI News
博客园_首页
Cisco Talos Blog
Cisco Talos Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Hacker News: Ask HN
Hacker News: Ask HN
TaoSecurity Blog
TaoSecurity Blog
腾讯CDC
MongoDB | Blog
MongoDB | Blog
M
MIT News - Artificial intelligence
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
Webroot Blog
Webroot Blog
Simon Willison's Weblog
Simon Willison's Weblog
Y
Y Combinator Blog
C
Cisco Blogs
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
AI
AI
W
WeLiveSecurity
aimingoo的专栏
aimingoo的专栏
The Register - Security
The Register - Security
Project Zero
Project Zero
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale

博客园 - 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)    收藏  举报

刷新页面返回顶部