iphone - Is there any way in NSFileManager to get contents of a file only for some range of bytes -
i have files of size 6.7gb, , more (these video files). want chunks of file data send server, :
contents = [filemanager contentsatpath:path]; if (mfileoffset<[contents length]) { nsrange range = nsmakerange(mfileoffset, (allowedsize>[contents length]?[contents length]:allowedsize); contents =[contents subdatawithrange:range];
however, produces memory issue:
malloc: *** mmap(size=616927232) failed (error code=12) *** error: can't allocate region *** set breakpoint in malloc_error_break debug app(2700,0x4136000) malloc: *** mmap(size=616927232) failed (error code=12) *** error: can't allocate region
is there way fseek
in c++
read bytes of file come in specified range only?
there method in nsfilehandle synchronously reads data specified number of bytes.
-[nsfilehandle readdataoflength:]
for seeking :
– offsetinfile – seektoendoffile – seektofileoffset:
Comments
Post a Comment