使用以下代码将文件从内部存储器复制到SD卡,反之亦然:
public static void copyFile(File src, File dst) throws IOException{ FileChannel inChannel = new FileInputStream(src).getChannel(); FileChannel outChannel = new FileOutputStream(dst).getChannel(); try { inChannel.transferTo(0, inChannel.size(), outChannel); } finally { if (inChannel != null) inChannel.close(); if (outChannel != null) outChannel.close(); }}
而且-它有效…
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)