云照片的内容读取方式跟本地文件不同,目前只能通过流的方式进行读取
ParcelFileDescriptor parcelFileDescriptor = context.getContentResolver().openFileDescriptor(Uri.parse(path),\"r\");FileDescriptor fileDescriptor = parcelFileDescriptor.getFileDescriptor();InputStream inputStream = new FileInputStream(fileDescriptor);BufferedInputStream reader = new BufferedInputStream(inputStream);// 创建本地文件写入流BufferedOutputStream outStream = new BufferedOutputStream(new FileOutputStream(filePath));byte[] buf = new byte[2048];int len;while ((len = reader.read(buf)) > 0) {outStream.write(buf, 0, len);}