随机访问文件> 2GB与Android SDK [英] Random Access files > 2GB with Android SDK

查看:130
本文介绍了随机访问文件> 2GB与Android SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我如何随机访问超过2GB的文件与Android SDK。
我试图寻求一个位置> 2147483647,得到了异常:值太大定义的数据类型。这是奇数作为寻求命令的参数的类型是长。详情请参阅code例如:

can anyone tell me how to random access a file beyond 2GB with android SDK. I was trying to seek to a position > 2147483647 and got the exception: "Value too large for defined datatype". That is odd as the parameter for the seek command is type "long". See the code example for details:

RandomAccessFile    BigFile;
BigFile = new RandomAccessFile(sMyFileName, "r");
BigFile.seek(2147483648);
   --> Exception

感谢您的帮助,
迈克尔

Thanks for any help, Michael

推荐答案

这是个例外,从本地/ IO(系统)层冒泡的结果。它不具有与在语言/ VM自身的类型的大小有关。在低杠杆的错误是EOVERFLOW(价值大的定义的数据类型)。 lseek的,例如,列出了这个错误。

That is the result of the exception bubbling up from the native/IO (system) layer. It doesn't have to do with the size of the type in the language/VM itself. The error at the lower lever is EOVERFLOW ("Value to large for defined data type"). lseek, for instance, lists this error.

假设:底层系统的访问是不是64位的感知:-)部分的真正的JRE中也有这个问题在历史上,IIRC。不知道在Android上的故事是什么。

Hypothesis: The underlying system access isn't 64-bit "aware" :-) Some real JREs also had this problem historically, IIRC. Not sure what the story on android is.

编辑:是在 FAT32文件大小为2GB线程有限似乎涉及了Android 2.x的(并包含有关内核构建和/或IO LIB限制的详细信息/提示/假设 - 的共识是它不工作)。

The thread at FAT32 file size limited to 2GB seems to relate the Android 2.x (and contains details/hints/hypothesis about the kernel build and/or IO lib limitations -- consensus is "it doesn't work").

这篇关于随机访问文件> 2GB与Android SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆