open static fun copyToByteArray(in: File): ByteArray
Copy the contents of the given input File into a new byte array.
IOException - in case of I/O errors
Return
the new byte array that has been copied to
open static fun copyToByteArray(@Nullable in: InputStream): ByteArray
Copy the contents of the given InputStream into a new byte array. Closes the stream when done.
in - the stream to copy from (may be null or empty)
IOException - in case of I/O errors
Return
the new byte array that has been copied to (possibly empty)