📜  fileoutputstream kotlin 示例 - Kotlin 代码示例

📅  最后修改于: 2022-03-11 14:53:32.556000             🧑  作者: Mango

代码示例1
val file:String = fileName.text.toString()  
val data:String = fileData.text.toString()  
val fileOutputStream:FileOutputStream  
try {  
    fileOutputStream = openFileOutput(file, Context.MODE_PRIVATE)  
    fileOutputStream.write(data.toByteArray())  
}catch (e: Exception){  
    e.printStackTrace()  
}