Topic: stringBuffer 写入文件 |
Print this page |
1.stringBuffer 写入文件 | Copy to clipboard |
Posted by: starxing Posted on: 2006-09-12 17:01 我现在有一个StringBuffer的实例,我要把他写入到一个文件中,我该怎么作? |
2.Re:stringBuffer 写入文件 [Re: starxing] | Copy to clipboard |
Posted by: bluecrystal Posted on: 2006-09-12 17:15 晕 看看api文档哈 java.io.* |
3.Re:stringBuffer 写入文件 [Re: starxing] | Copy to clipboard |
Posted by: q_yuan Posted on: 2006-09-15 20:56 String string; FileOutputStream fout; DataOutputStream bfo = null; try{ string = stringBuffer.substring(0); bfo = new DataOutputStream(new FileOutputStream(fileName)); bfo.write(string.getBytes()); }catch(Exception ex){ System.out.println(ex.toString()); } |
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 |