loading files in byte array to reduce memory usage