1

请问谁能告诉我如何将RMS数据存储到文件以及如何修改它?

4

1 回答 1

0

您可以使用此代码将数据写入文件。

private void writeTextFile(String fName, String text) { 
    DataOutputStream dos = null; 
    FileConnection fconn = null; 
    try { 
        fconn = (FileConnection) Connector.open(fName, Connector.READ_WRITE); 
        if (!fconn.exists()) 
            fconn.create();
        dos = fconn.openDataOutputStream(); 
        dos.write(text.getBytes()); 
    } catch (IOException e) { 
        System.out.println(e.getMessage()); 
    } finally { 
        try { 
            if (dos != null) 
            dos.close(); 
            if (fconn != null) 
                fconn.close(); 
        } catch (IOException e) {
            System.out.println(e.getMessage()); 
        } 
    } 
}
于 2010-12-14T06:51:37.810 回答