I / O流问题 [英] I/O Streams Problem

查看:82
本文介绍了I / O流问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试从文件中读取并在控制台中打印。但是在运行代码时,只需在文本文件中显示最后一个字母,以及大量空白区域。请帮我找到错误..

Am trying to read from a file and print it in the console. But while running the code, just getting the last letter present in my text file and lots of empty spaces. Pls help me to find the error..

展开 | 选择 | Wrap | 行号

推荐答案


我试图从文件中读取并在控制台中打印它。但是在运行代码时,只需在文本文件中显示最后一个字母,以及大量空白区域。请帮我找到错误..

Am trying to read from a file and print it in the console. But while running the code, just getting the last letter present in my text file and lots of empty spaces. Pls help me to find the error..

展开 | 选择 | Wrap | 行号


不要使用XXXInputStreams来读取文本文件。这是非常错误的做法。


使用FileReader或Scanner解释这里。
Do not use XXXInputStreams for reading text files. That is the the very wrong way of doing it.

Use FileReader or Scanner as explained here.


你好回复...


ro,我会尝试使用File并看到...


但现在我的问题是,我能够读取文件,并根据我的文本文件中的字母数字,创建文件。例如2个字母的单词意味着2.txt等..


问题是不是附加到输出文件,而是被覆盖..


请帮助我...

Hi Thnks for the reply...

ro, i will try using File and see...

but now my problem is, am able to read the file and according to the number of letters in the words in my text file, am creating files. Eg 2 letter word means 2.txt etc..

The problem is instead of appending to the output file, its getting overwritten..

Pls help me...

展开 | 选择 | Wrap | 行号


这篇关于I / O流问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆