1
0
Fork 0
happy-cat/src/jvmMain/kotlin/fi/schro/util/FileUtil.kt

19 lines
505 B
Kotlin

/*
* Copyright (c) 2022 Florian Schrofner
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package fi.schro.util
import java.io.File
class FileUtilImpl: FileUtil {
override fun readAllText(filePath: String): String {
return File(filePath).inputStream().use {
it.readBytes().toString(Charsets.UTF_8)
}
}
}