高级Java文件I / O教程?提示?建议吗? [英] Advanced Java File I/O tutorials? Tips? Advice?

查看:167
本文介绍了高级Java文件I / O教程?提示?建议吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个项目,它将利用Java文件I / O,它超越了我在网上找到的简单的将此字符串写入文件文档和教程。该项目本质上将提供一种数据库机制,类似于流行的NoSQL数据库,这些数据库近来获得了大量的关注。但是,我无法找到大量文档,提供有关使用哪些API,如何使用它们等的详细信息。我一直在寻找围绕Java File I / O的任何普遍接受的设计模式,但没有祝你好运。

I'm working on a project right now that will make use of Java File I/O that goes beyond the simple "write this string to a file" documentation and tutorials that I find on the net. This project will essentially provide a database mechanism, similar to the popular "NoSQL" databases that are gaining a lot of press these days. However, I'm unable to find a ton of documentation that provides detailed information on which APIs to use, how to use them, etc. I've also been looking for any generally accepted design patterns around Java File I/O, but without any luck.

如果我必须列出一些要求,我会说:

If I had to list a couple of requirements, I'd say:


  • 伪事务支持(不是硬性要求,因为它可以在API堆栈中实现更高)

  • 能够在结构中写入任意长度的数据可以在以后阅读

  • 索引

  • 能够有效地从数据库中删除对象

  • 快速搜索

  • 可能的多线程访问(多个读取线程,单次写入,最有可能)

  • Pseudo-transactional support (not a hard requirement, as it can be implemented higher up in the API stack)
  • Ability to write data of an arbitrary length in a structure that can be read back later on
  • Indexing
  • Ability to remove an object from the "database" efficiently
  • Fast searching
  • Possible multi-threaded access (multiple read threads, single write, most likely)

有人能指出我可能有用的任何教程,文档,设计模式等吗?是否有任何围绕Java File I / O的开源框架?我知道有很多框架可以为网络I / O提供NIO周围的包装,但没有与文件相关的内容。

Can anyone point me to any tutorials, documentation, design patterns, etc. that may be helpful? Are there any open source frameworks that revolve around Java File I/O? I know of a lot of frameworks that provide wrappers around NIO for the purposes of Network I/O, but nothing File-related.

感谢您提供的任何帮助!

Thanks for any help you can provide!

推荐答案

看看 Apache Commons Transaction 。它支持事务性文件访问,通过在临时文件中执行工作,并通过将工作移动到实际文件来提交工作。

Take a look at Apache Commons Transaction. It supports transactional file access, by performing the work in temporary files, and committing the work by moving them to the actual files.

您可能也对 XADisk 项目,虽然我没有仔细研究它的来源。

You might also be interested in the XADisk project, although I haven't pored through it's sources.

就搜索而言,Apache Solr Lucene 项目会有所帮助。

As far as searching is concerned, the Apache Solr and Lucene projects would be of help.

这篇关于高级Java文件I / O教程?提示?建议吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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