inputStreamToByteArray

static Array<byte> inputStreamToByteArray(@NonNull() InputStream inputStream)

Reads the input stream to a byte array.

Return

byte array with input streams content

Parameters

inputStream

an open InputStream to read from, caller is responsible for closing

Throws

if the first byte cannot be read for any reason other than the end of the file, if the input stream has been closed, or if some other I/O error occurs.