简体   繁体   English

Java Applet随机存取存储

[英]Java Applet random access storage

I have a java project that uses java.io.RandomAccessFile to manage data loading. 我有一个java项目,它使用java.io.RandomAccessFile来管理数据加载。 It seeks through the file creating a map of key points which can then be loaded as needed later. 它通过文件寻找创建关键点的映射,然后可以根据需要加载。 This works great. 这非常有效。

I want to make it run as an applet but it requires security permissions to create a temp file that a downloaded file could be stored in, and that's a huge barrier for it's intended usage. 我想让它作为applet运行,但它需要安全权限来创建一个临时文件,下载的文件可以存储在其中,这对于它的预期用途来说是一个巨大的障碍。

I think I can spare the memory (a few MB) to store the contents in a memory buffer of some sort and then random access it in the same way I treat local files... 我想我可以节省内存(几MB)将内容存储在某种内存缓冲区中,然后以与处理本地文件相同的方式随机访问它...

Is there a way to create a temp file without requiring security permissions (I assume not)? 有没有办法在不需要安全权限的情况下创建临时文件(我假设没有)?

What is the best buffering option? 什么是最好的缓冲选项? How would I get the contents of a URL based input stream into the buffer, read bytes from it, and be able to record and change the current seek position? 如何将基于URL的输入流的内容放入缓冲区,从中读取字节,并能够记录和更改当前的搜索位置?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM