LevelDB JNI

程序名称:LevelDB JNI

授权协议: CDDL

操作系统: Linux

开发语言: Java

LevelDB JNI 介绍

LevelDB JNI 提供了 Google 高效的Key/Value数据库
LevelDB 的 Java 接口。

示例代码:

import org.fusesource.leveldbjni.*;
import static org.fusesource.leveldbjni.DB.*;
import java.io.*;

Options options = new Options();
options.setCreateIfMissing(true);
DB db = DB.open(options, new File("example"));
try {
  // Use the db in here....
} finally {
  // Make sure you delete the db to shutdown the 
  // database and avoid resource leaks.
  db.delete();
}

WriteOptions wo = new WriteOptions();
ReadOptions ro = new ReadOptions();

db.put(wo, bytes("Tampa"), bytes("rocks"));
String value = asString(db.get(ro, bytes("Tampa")));
db.delete(wo, bytes("Tampa"));

LevelDB JNI 官网

https://github.com/fusesource/leveldbjni

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐