管理上的文件的java大阵 [英] Manage large array on a file java

查看:145
本文介绍了管理上的文件的java大阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写一个Android应用程序,需要大量的内存,有时候我的双阵列到达兆的大小和我莫名其妙地需要所有可用可行的时间数据。我看到大部分的时间,我只是不能让他们都上RAM。所以我要寻找一个Java API,让我创建的文件系统,而不是在RAM上管理阵列,该API应该给我充当如果它是一个真正的阵列的功能,例如,它必须有GET(INT指数)集(INT指数)和长度(),做同样的,如果它是一个真正的阵列的方法。

I am writing an android app that requires a lot of memory, sometimes my double arrays gets to sizes of Megabytes and i somehow need all that data available at feasible time. I see that most of the time i just cant have them all on RAM. so i am looking for a java API that lets me create arrays that are managed on the file system rather than on RAM, the api should give me the ability to act as if it was a real array, eg, it must have get(int index) set(int index) and length() methods that does the same as if it was a real array.

任何人都知道,做这样的事情一个良好图书馆?或者提出一个更好的办法?

anyone know of a good library that does something like that? or maybe suggest a better approach?

推荐答案

您可能希望有一个看的 MappedByteBuffer 以及它的 asFloatBuffer() 方法。

You might want to have a look at the MappedByteBuffer and it's asFloatBuffer() methods.

这篇关于管理上的文件的java大阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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