1

我正在研究黑莓,我有一个Jar文件jaudiotagger,但在黑莓中java.io.File不可用。有没有Jar可用的文件?

4

1 回答 1

1

通常java.io.File的 Java API 不适用于 BB。

请参阅 BB API 文档以了解javax.microedition.io.Connectorjavax.microedition.io.file.FileConnection

您将需要执行以下操作:

FileConnection fconn = (FileConnection) Connector.open("file:///CFCard/newfile.txt");

// If no exception is thrown, then the URI is valid, but the file may or may not exist.
if (!fconn.exists()) fconn.create(); // create the file if it doesn't exist

OutputStream os = fconn.openOutputStream();

//...

fconn.close();
于 2013-03-02T09:04:48.267 回答