Changed from temp files to no files / uses ByteArrayInputStream instead