2009-04-15 104 views

回答

2

這是可能的,打開資源流:

String fileName = "/myPath/myFile.mp3"; 
InputStream inputStream = getClass().getResourceAsStream(fileName); 

然後讀取流並寫入到一個文件:

String locator = "file:///SDCard"+fileName; 
FileConnection saveFile = (FileConnection)Connector.open(locator); 
saveFile.create(); 
OutputStream outputStream = saveFile.openOutputStream(); 

我敢肯定,你可以遍歷的inputStream將其複製到outputStream,然後關閉。

相關問題