ntc-jleveldb

ntc-jleveldb is a module swapper java leveldb

License

License

GroupId

GroupId

com.streetcodevn
ArtifactId

ArtifactId

ntc-jleveldb
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

ntc-jleveldb
ntc-jleveldb is a module swapper java leveldb
Project URL

Project URL

https://github.com/congnghia0609/ntc-jleveldb
Source Code Management

Source Code Management

https://github.com/congnghia0609/ntc-jleveldb/tree/master

Download ntc-jleveldb

How to add to project

<!-- https://jarcasting.com/artifacts/com.streetcodevn/ntc-jleveldb/ -->
<dependency>
    <groupId>com.streetcodevn</groupId>
    <artifactId>ntc-jleveldb</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.streetcodevn/ntc-jleveldb/
implementation 'com.streetcodevn:ntc-jleveldb:1.0.0'
// https://jarcasting.com/artifacts/com.streetcodevn/ntc-jleveldb/
implementation ("com.streetcodevn:ntc-jleveldb:1.0.0")
'com.streetcodevn:ntc-jleveldb:jar:1.0.0'
<dependency org="com.streetcodevn" name="ntc-jleveldb" rev="1.0.0">
  <artifact name="ntc-jleveldb" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.streetcodevn', module='ntc-jleveldb', version='1.0.0')
)
libraryDependencies += "com.streetcodevn" % "ntc-jleveldb" % "1.0.0"
[com.streetcodevn/ntc-jleveldb "1.0.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.30
ch.qos.logback : logback-classic jar 1.2.3
ch.qos.logback : logback-core jar 1.2.3
org.fusesource.leveldbjni : leveldbjni-all jar 1.8

test (1)

Group / Artifact Type Version
junit : junit jar 4.13

Project Modules

There are no modules declared in this project.

ntc-jleveldb

ntc-jleveldb is a module swapper java leveldb

Maven

<dependency>
    <groupId>com.streetcodevn</groupId>
    <artifactId>ntc-jleveldb</artifactId>
    <version>1.0.0</version>
</dependency>

Usage

NLSerializer nls = new NLSerializer();
String dbPath = "./db";
LDBSingleConnection conn = LDBSingleConnection.getInstance(dbPath);


String key = "nghiatc";
String value = "handsome";
// Put Data
conn.put(key, value);
// Get Data
String rs1 = conn.get(key);
Assert.assertEquals(value, rs1);
String rs2 = nls.deserializeString(conn.getByte(nls.serializeString(key)));
Assert.assertEquals(value, rs2);
// Delete Data
conn.delete(key);
String rs3 = conn.get(key);
Assert.assertEquals(null, rs3);


conn.close();

License

This code is under the Apache License v2.

Versions

Version
1.0.0