简体   繁体   English

读取/写入在线applet的大.ser文件的最有效方法

[英]Most effective way to read/write large .ser file for online applet

I am writing an applet that I eventually want to put online so that my friends/family can use it. 我正在编写一个小程序,我最终希望将其放在网上,以便我的朋友/家人可以使用它。 I have the applet running now locally, but in order to work properly it needs to read a .ser file in when the applet opens, and update that same file when the applet closes. 我的小程序现在在本地运行,但是为了正常工作,它需要在小程序打开时读取一个.ser文件,并在小程序关闭时更新该文件。 The file is quite large (~180 MB), though I am working on paring it down. 该文件非常大(〜180 MB),尽管我正在努力进行缩减。

What would be the fastest/most effective way to read/write this file in java? 用Java读取/写入此文件的最快/最有效的方法是什么? There is a lot of information out there on this and I have never done anything like it before, so it's a bit overwhelming. 那里有很多信息,我以前从未做过类似的事情,所以有点让人不知所措。 The class HTTPURLConnection seems like an option to read it, but not write it. HTTPURLConnection类似乎是读取但不写入的选项。 Any free web hosting that I have seen will not allow a file that big to be uploaded. 我见过的任何免费虚拟主机都不允许上传这么大的文件。

The size of the file should hopefully go down substantially, it is a list of 2.8 million musical artists, many of which I'm sure nobody using the program will ever encounter, but if this program is to be effective, many artists will have to be stored, so the problem most likely remains the same. 希望该文件的大小会大大减少,它是一个280万音乐艺术家的列表,我相信其中很多人都不会遇到使用该程序的人,但是如果该程序有效,那么许多艺术家将不得不被存储,因此问题很可能保持不变。

Thanks in advance for any help 预先感谢您的任何帮助

It sounds like it would be wise to keep this large data and the processing of it on your server instead of making the applet operate on it. 听起来将大数据及其处理保留在服务器上而不是使applet在其上运行似乎是明智的。 That's because you would avoid each user downloading a large file and processing it. 这是因为您可以避免每个用户下载大文件并进行处理。 If you had a server side piece that the applet could call to get useful information from, then only your server would have to load it, write it, and process it. 如果您有一个可以调用applet来获取有用信息的服务器端部件,那么只有您的服务器才需要加载,编写和处理它。 You could implement a Java servlet, or a PHP program to respond to http requests from your applet in a format that suits the data. 您可以实现Java servlet或PHP程序,以适合数据的格式响应applet的http请求。 I'm assuming that your server can handle either servlets or custom PHP (most can). 我假设您的服务器可以处理servlet或自定义PHP(大多数可以)。

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

相关问题 将File写入ServletOutputStream的最有效方法 - Most effective way to write File to ServletOutputStream 使用ObjectOutputStream将一系列对象写入.ser文件并读回它们的最佳方法 - best way to write series of objects to a .ser file using ObjectOutputStream and read them back 从TCP套接字读取的最有效方法 - Most effective way to read from a TCP socket 用Java编写大型文本文件的最有效方法是什么? - What's the most efficient way to write large text file in java? 使用Java 7在生产应用程序中没有任何泄漏的情况下读取文件的最有效方法是什么 - What is the most effective way to read a file without any leaks in production app using java 7 将RxJava排放写入文本文件的有效方法? - Effective Way to Write RxJava Emissions to Text File? 读取大量文件名的最有效方法是什么? - What is the most effective way to read names of a lot of files? 是否可以从applet读取/写入文件 - Is it possible to read/write a file from an applet 读取文件和解析每一行的有效方法 - Effective way to read file and parse each line Android 从大型 json 文件中读取写入段的有效方法 - Android efficient way to read write segments from a large json file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM