readBytes

Gets the entire content of this file as a byte array.

This method is not recommended on huge files. It has an internal limitation of 2 GB byte array size.

Since Kotlin

1.0

Return

the entire content of this file as a byte array.


Reads this stream completely into a byte array.

Note: It is the caller's responsibility to close this stream.

Since Kotlin

1.3

Reads the entire content of the URL as byte array.

This method is not recommended on huge files.

Since Kotlin

1.0

Return

a byte array with this URL entire content.


fun InputStream.readBytes(estimatedSize: Int = DEFAULT_BUFFER_SIZE): ByteArray(source)

Deprecated

Use readBytes() overload without estimatedSize parameter

Replace with

readBytes()

Reads this stream completely into a byte array.

Note: It is the caller's responsibility to close this stream.

Since Kotlin

1.0