Android NIO - java.io.IOException: Value too large for defined data type

后端 未结 2 378
旧时难觅i
旧时难觅i 2021-01-26 12:29

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

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-26 13:22

    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.

提交回复
热议问题