Refactored InputStream-byte[] read to Utils#toByteArray()