getBytesFromUri

static Array<byte> getBytesFromUri(@NonNull() Uri uri, @NonNull() Context context)

Reads the contents of the resource pointed to by the Uri into a byte array.

Return

contents of the Uri

Parameters

uri

a Uri pointing to a file

context

Android context

Throws

if there is an issue with the input stream from the Uri

if null input stream was returned by the Context's Content Resolver