Topic: 写入RandomAccessFile文件时,怎样换行? |
Print this page |
1.写入RandomAccessFile文件时,怎样换行? | Copy to clipboard |
Posted by: liugongquan Posted on: 2005-06-17 20:30 写入一行字符串到RandomAccessFile文件后,怎样换行呢,有哪位知道请指教,谢谢! |
2.Re:写入RandomAccessFile文件时,怎样换行? [Re: liugongquan] | Copy to clipboard |
Posted by: why Posted on: 2005-06-21 20:34 Why do you need 换行 when writing to RandomAccessFile文件? Anyway, you could always include a \n or the system property line.separator at the end of the 字符串. |
3.Re:写入RandomAccessFile文件时,怎样换行? [Re: liugongquan] | Copy to clipboard |
Posted by: liugongquan Posted on: 2005-06-22 08:51 Thank you very much from the bottom of my heart! Any more questions will be sent to you ,if any. |
4.Re:写入RandomAccessFile文件时,怎样换行? [Re: liugongquan] | Copy to clipboard |
Posted by: jiyunang Posted on: 2005-07-19 12:56 有时候\n要与\r合用, 关键看你程序的操作平台, 以及生成文档中的改行到底是设么。 |
5.Re:写入RandomAccessFile文件时,怎样换行? [Re: liugongquan] | Copy to clipboard |
Posted by: Butterfly_125 Posted on: 2005-07-19 13:30
ra.write(e1.name.getBytes());中getBytes()是什么意思? SDK是这样说的: Encodes this String into a sequence of bytes using the platform's default charset, storing the result into a new byte array. The behavior of this method when this string cannot be encoded in the default charset is unspecified. The CharsetEncoder class should be used when more control over the encoding process is required. 我还是看不太懂。如果e1.name为中文,输出就有点问题,这是什么? |
6.Re:写入RandomAccessFile文件时,怎样换行? [Re: jiyunang] | Copy to clipboard |
Posted by: snowbird2005 Posted on: 2005-07-19 19:03 用下边这个方法: byte[] getBytes(String charsetName) Encodes this String into a sequence of bytes using the named charset, storing the result into a new byte array. |
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 |