private fun copyAssets() {
try {
val assetManager = activity!!.assets
val inputBundlePath = bundle_name
val outputBundleDir = activity!!.filesDir.absolutePath + File.separator
val inputStream = assetManager.open(inputBundlePath)
val outputBundleFile = File(outputBundleDir, bundle_name)
val outputStream = FileOutputStream(outputBundleFile)
var length: Int
val buffer = ByteArray(1024)
while (inputStream.read(buffer) > 0) {
length = inputStream.read(buffer)
outputStream.write(buffer, 0, length)
}
inputStream.close()
outputStream.close()
} catch (e: IOException) {
Log.d(module_log, "Cannot copy bundle: " + e.message)
}
}