I\'m trying to write a very large file to another very large file. I\'m receiving this error on the filechannel writing line and I\'m unsure why. I thought it was because I was
Unfortunately a Long does not go that high on a 32-bit system (which I believe Android is since it doesn't have over 4Gb of RAM). Therefore the maximum length of an unsigned long on Android is 4,294,967,295 which means you are exceeding its limit.
Is there some limit that MappedByteBuffer has?
Of course there is. It is limited by the available virtual memory for a start, and after that by the virtual address space.
You should be using transferTo()
for this task rather than MappedByteBuffers,
, as there is no agreed means of disposing of the virtual address space occupied by the latter.