Hi.
I'm trying to load files from server with UrlLoader, and somehow "not enough memory" pops up on a certain file.
A source code with actual URL is as follows. (You can download the file at URL.)
--------------------------------------------------
function func(event)
print(#event.data)
end
-- please get rid of -s in the URL. I'm not supposed to post an link here.
loader = UrlLoader.new("
http://175.207.4.34/test/test.bin");
loader:addEventListener(Event.COMPLETE,func);
--------------------------------------------------
Using io.read also makes same error. Here is a sample.
--------------------------------------------------
function load(filename)
local file = io.open(filename,"rb")
if file==nil then
return {}
else
local result = file:read("*all")
file:close()
return result
end
end
--------------------------------------------------
I'v tested file's size and a file size is between 5111792 bytes and 5242863 bytes can't be read by UrlLoader.
Once you read the file bigger then 5242863 successfully, you can read a file which size is in the zone (5111792 ~ 5242863) as long as you don't rerun the Gideros player.
Comments
Currently I can't tell if it is on Gideros side or Lua/environment side
But what you can do instead for now is to read with smaller buffer like: