Java 中的 Palm 数据库 (PDB) 文件?

发布于 2024-08-09 19:35:31 字数 173 浏览 2 评论 0原文

有人用 Java 编写过用于读写 Palm 数据库 (PDB) 文件的类吗? (我的意思是在服务器上,而不是在 Palm 设备本身上。)我尝试用谷歌搜索,但我得到的只是蛋白质数据库参考。

我编写了一个使用 Palm::PDB.pm 执行此操作的 Perl 程序,但我想将其转换为 GWT 应用程序的 servlet。

Has anybody written any classes for reading and writing Palm Database (PDB) files in Java? (I mean on a server, not on the Palm device itself.) I tried to google, but all I got were Protein Data Bank references.

I wrote a Perl program that does it using Palm::PDB.pm, but I want to turn it into a servlet for a GWT app.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

﹂绝世的画 2024-08-16 19:35:31

http://www.jsyncmanager.org/ 上的 jSyncManager 项目位于 LGPL 下,包含要读取的类并编写 PDB 文件——查看 jSyncManager/API/Protocol/Util/DLPDatabase.java 的源代码。看起来您需要的核心代码可以通过一点努力与库的其余部分隔离。

The jSyncManager project at http://www.jsyncmanager.org/ is under the LGPL and includes classes to read and write PDB files -- look in jSyncManager/API/Protocol/Util/DLPDatabase.java in its source code. It looks like the core code you need from this could be isolated from the rest of the library with a little effort.

屋顶上的小猫咪 2024-08-16 19:35:31

有几种方法可以解决这个问题;

  1. 最简单但最慢:找到一个 perl->爪哇桥。这不会很快,但它会起作用,并且应该涉及最少的工作量。
  2. 找到一个您有源代码的 C++/C# 实现并将其转换(这应该是最快的解决方案)
  3. 找到一个 Java 阅读器...谷歌下似乎列出了一些...但是我没有任何经验这些。

There are a few ways that you can go about this;

  1. Easiest but slowest: Find a perl-> java bridge. This will not be quick, but it will work and it should involve the least amount of work.
  2. Find a C++/C# implementation that you have the source to and convert it (this should be the fastest solution)
  3. Find a Java reader ... there seems to be a few listed under google... however I do not have any experience with these.
樱花落人离去 2024-08-16 19:35:31

根据您的预期用途,您可能会考虑自己编写一个简单的阅读器。格式非常简单,您只需要处理几个简单的字段即可解析它。

基本上,整个文件有一个标头,其末尾有一个 2 字节整数,用于指定记录数。因此,只需跳过标头中所有其他字段的字节,然后读取最后一个字段,即文件中的记录数。请注意,PDB 格式首先写入最高有效字节的整数。

接下来,每个记录都会有一个记录头,其中第一个字段是记录本身在文件中的实际偏移量。再次注意字节顺序。

因此,现在您已经有了文件中每条记录的偏移量,只要您知道要读取的 PDB 文件类型的这些记录的格式,就可以很容易地读取实际记录。

Wikipedia 对标头格式有很好的概述。

Depending on what your intended usage is, you might look into writing a simple reader yourself. The format is pretty simple and you only need to handle a couple of simple fields to parse it.

Basically there is a header for the entire file which has a 2 byte integer at the end which specifies the number of record. So just skip your way through the bytes for all the other fields in the header and then read the last field which is the number of records in the file. Be aware that the PDB format writes integers with most significant byte first.

Following this, there will be a record header for each record, the first field of which is the actual offset into the file for the record itself. Again, be aware of the byte order.

So, now you have the offsets into the file for each record in the file, which should make it very easy to read the actual records as long as you know the format of these for the type of PDB file you are trying to read.

Wikipedia has a nice overview of the header formats.

水溶 2024-08-16 19:35:31

也许 JPilot 可以提供帮助?他们必须有大量处理 Palm OS 数据的 Java 代码。

Maybe JPilot can help? They must have a lot of Java code dealing with Palm OS data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文