File 从blackberry应用程序保存远程文件
如何从自定义应用程序将远程文件(即)保存到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(); 编辑:要将文件保存到磁盘,请打开文件连接并从中打开
谢谢使用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写入磁盘?