/**
* 把字符串追加到文本里去
*
* @param str
*/
public void writeStringToFile(String str) {
FileConnection fc;
try {
String file = "file:///c:/barcode.txt";
fc = (FileConnection) Connector.open(file01, Connector.READ_WRITE);
if (!fc.exists()) {
fc.create();
}
OutputStream os = fc.openOutputStream(fc.fileSize());
DataOutputStream dos = new
DataOutputStream(os);
dos.write((str).getBytes("utf-8"));
dos.write("\r\n".getBytes());
os.close();
dos.close();
fc.close();
} catch (IOException e) {
e.printStackTrace();
}
}
J2ME程序在手机上测试记录下调试信息
最新推荐文章于 2024-07-09 17:58:26 发布