readBytes
Platform and version requirements: JVM (1.5), JRE7 (1.5)
fun Path.readBytes(): ByteArray
Gets the entire content of this file as a byte array.
It's not recommended to use this function on huge files. It has an internal limitation of approximately 2 GB byte array size. For reading large files or files of unknown size, open an InputStream and read blocks sequentially.
Return the entire content of this file as a byte array.
© 2010–2021 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io.path/java.nio.file.-path/read-bytes.html