readBytes

JVM
JRE7
1.5
fun Path.readBytes(): ByteArray
(source)

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.