Topic: java io 方法的选择。(FileWriter和 BufferedWriter) |
Print this page |
1.java io 方法的选择。(FileWriter和 BufferedWriter) | Copy to clipboard |
Posted by: develop8 Posted on: 2006-06-23 07:35 /*因为FileWriter和 BufferedWriter 使用的都是类writer的write方法 所以在这里FileWriter没必要用BufferedWriter来包装, 因为BufferedWriter没有自己更高明的方法,都是使用同样的 父类的方法。不象BufferedReader 类独有ReadLine方法, 所以在这里我没有使用BufferedWriter类,不知道我说的 对不对???? 请读者评价 !!! */
|
2.Re:java io 方法的选择。(FileWriter和 BufferedWriter) [Re: develop8] | Copy to clipboard |
Posted by: lisliefor Posted on: 2006-06-23 09:49 io流这块很大,没有很深的研究,不敢妄下评断。不过,我可以肯定楼主的理解是非常不.......的。 |
3.Re:java io 方法的选择。(FileWriter和 BufferedWriter) [Re: develop8] | Copy to clipboard |
Posted by: why Posted on: 2006-06-23 09:52 read the API doc: http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedWriter.html In general, a Writer sends its output immediately to the underlying character or byte stream. Unless prompt output is required, it is advisable to wrap a BufferedWriter around any Writer whose write() operations may be costly, such as FileWriters and OutputStreamWriters. |
4.Re:java io 方法的选择。(FileWriter和 BufferedWriter) [Re: develop8] | Copy to clipboard |
Posted by: yuxiangyu Posted on: 2006-06-23 21:31 BufferedString好像有缓冲功能,可以加快速度! |
5.Re:java io 方法的选择。(FileWriter和 BufferedWriter) [Re: develop8] | Copy to clipboard |
Posted by: QwerXZC Posted on: 2006-06-29 23:17 楼上的,不好意思,应该是java.lang.StringBuffer吧 |
6.Re:java io 方法的选择。(FileWriter和 BufferedWriter) [Re: develop8] | Copy to clipboard |
Posted by: develop8 Posted on: 2006-07-02 06:24 跟 StringBuffer 有什么关系? 读写的都是依 string来写的, 你说的是StringBuffer sbuf; sbuf=sbuf.append(String) 然后写的时候转化为string 是吗?这样效率要高很多吗? 只有在过程里用是吗? |
7.Re:java io 方法的选择。(FileWriter和 BufferedWriter) [Re: develop8] | Copy to clipboard |
Posted by: why Posted on: 2006-07-02 06:35 跟 StringBuffer 看看api doc 吧, FileWriter "sends its output immediately". |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |