Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File 从blackberry应用程序保存远程文件_File_Blackberry - Fatal编程技术网

File 从blackberry应用程序保存远程文件

File 从blackberry应用程序保存远程文件,file,blackberry,File,Blackberry,如何从自定义应用程序将远程文件(即)保存到blackberry的本地磁盘 谢谢使用Connector.Open(URL)打开HttpConnection。然后从该连接打开输入流,例如: HttpConnection conn = (HttpConnection) Connector.open("http://example.com/somefile.pdf"); InputStream in = conn.openInputStream(); 编辑:要将文件保存到磁盘,请打开文件连接并从中打开

如何从自定义应用程序将远程文件(即)保存到blackberry的本地磁盘


谢谢

使用Connector.Open(URL)打开HttpConnection。然后从该连接打开输入流,例如:

HttpConnection conn = (HttpConnection) Connector.open("http://example.com/somefile.pdf");
InputStream in = conn.openInputStream();
编辑:要将文件保存到磁盘,请打开文件连接并从中打开输出流。e、 g:

    FileConnection file = (FileConnection) Connector.open("file:///store/home/user/myfile.pdf");
file.create();
OutputStream out = file.openOutputStream();

那么如何将inputstream写入磁盘?