我可以使用 H2、HSQLDB 或任何其他嵌入式数据库吗?InputStream
而不是文件?
我打算使用AssetManager.open() http://developer.android.com/reference/android/content/res/AssetManager.html#open%28java.lang.String,%20int%29在 Android 上,它可以返回InputStream
在随机访问模式下。
H2 支持可插拔文件系统 http://h2database.com/html/advanced.html#file_system允许您访问zip 或 jar 文件中的只读数据库 http://h2database.com/html/features.html#database_in_zip。然而,目前还没有文件系统实现AssetManager
。实施起来应该比较容易。最好的起点可能是文件系统Zip http://code.google.com/p/h2database/source/browse/trunk/h2/src/main/org/h2/store/fs/FileSystemZip.java and 文件对象压缩 http://code.google.com/p/h2database/source/browse/trunk/h2/src/main/org/h2/store/fs/FileObjectZip.java.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)