From acd57fcd6db739dddf69e219638acab7a28b01c4 Mon Sep 17 00:00:00 2001
From: MacBuilder <MacBuilder@secondworld.com>
Date: 星期五, 26 十月 2018 13:47:45 +0800
Subject: [PATCH] Merge commit 'ab36230278c858a46b798c20c1c262c2763b94a0'

---
 Project/sp_sdk/src/main/java/com/secondworld/univeralsdk/FileUtil.java |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/Project/sp_sdk/src/main/java/com/secondworld/univeralsdk/FileUtil.java b/Project/sp_sdk/src/main/java/com/secondworld/univeralsdk/FileUtil.java
index fbb1a8d..3ffcb8b 100644
--- a/Project/sp_sdk/src/main/java/com/secondworld/univeralsdk/FileUtil.java
+++ b/Project/sp_sdk/src/main/java/com/secondworld/univeralsdk/FileUtil.java
@@ -104,6 +104,31 @@
         }).start();
     }
 
+    public static void copy(Context context, String fileName)
+    {
+        String _originalPath = "android" + File.separator + fileName;
+        String _destPath = context.getExternalFilesDir(
+                "").getAbsolutePath() + File.separator + fileName;
+        try
+        {
+            InputStream _is = context.getAssets().open(_originalPath);
+            FileOutputStream _fos = new FileOutputStream(new File(_destPath));
+            byte[] _buffer = new byte[1024];
+            int _byteCount;
+            while ((_byteCount = _is.read(_buffer)) != -1)
+            {
+                _fos.write(_buffer, 0, _byteCount);
+            }
+            _fos.flush();
+            _is.close();
+            _fos.close();
+            LogUtil.i("FileUtil", "鍗曠嫭鎷疯礉 => 鏂囦欢: " + _originalPath + " 宸叉嫹璐濊嚦: " + _destPath);
+        } catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
     public static void copy(Context context, String original, String dest)
     {
         try

--
Gitblit v1.8.0