Use input stream instead of byte arrays to avoid memory problems