File handling in blackberry

人走茶凉 提交于 2019-12-11 06:21:16

问题


Is it possible to open file in append mode in blackberry? In Connector class there are constants READ, WRITE, READ_WRITE but I didn't find any constant for append mode.


回答1:


It is possible, though it isn't a separate mode:

FileConnection fc = (FileConnection) Connector.open(pathToFile, Connector.READ_WRITE);
OutputStream out = fc.openOutputStream(fc.fileSize());
// Now you can write to the output stream and it will append to the end of the file


来源:https://stackoverflow.com/questions/6422553/file-handling-in-blackberry

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!