ByteArrayOutputStream -> InputStream for CardReader uploads.
Added test to assure cards are encoded correctly.

[#80581522]