fix
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package pw.binom.llmproxy
|
||||
|
||||
import kotlinx.io.Buffer
|
||||
import kotlinx.io.files.Path
|
||||
import kotlinx.io.files.SystemFileSystem
|
||||
import kotlinx.io.readByteArray
|
||||
|
||||
internal fun readConfigText(path: String): String {
|
||||
val src = SystemFileSystem.source(Path(path))
|
||||
try {
|
||||
val buf = Buffer()
|
||||
while (src.readAtMostTo(buf, Long.MAX_VALUE) > 0L) { }
|
||||
return buf.readByteArray().decodeToString()
|
||||
} finally {
|
||||
src.close()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user