Kotlin File writeText appendText appendBytes readBytes readText
fun main(args: Array<String>) {
val filePath = "./myfile.txt"
val file = File(filePath)
file.appendText("world!")
file.appendBytes("2023 year".toByteArray())
val bytes: ByteArray = file.readBytes()
Kotlin Files readAllBytes readAllLines readString-CSDN博客Java把一个文件转化为byte字节数组 /** * 把一个文件转化为byte字节数组。try { File..._java文件转byte数组。Java把一个文件转化为byte字节数组_java文件转byte数组_zhangphil的博客-CSDN博客。
https://blog.csdn.net/zhangphil/article/details/132763802