2011-06-21 33 views
1

是否可以在黑莓中以追加模式打開文件?在Connector類中有常量READ,WRITE,READ_WRITE,但我沒有發現任何常量用於追加模式。黑莓中的文件處理

回答

2

這是可能的,但它不是一個獨立的模式:

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 
+0

非常感謝。它的工作 – gauri