Skip to content

Instantly share code, notes, and snippets.

@krisskross
Last active June 21, 2016 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisskross/44479ba1320becbe869c1c6adba011ea to your computer and use it in GitHub Desktop.
Save krisskross/44479ba1320becbe869c1c6adba011ea to your computer and use it in GitHub Desktop.
ByteBuffer seekKey = ByteBuffer.allocateDirect(4).putInt(4);
try (Cursor cursor = db.openCursor(tx)) {
if (cursor.get(seekKey, MDB_SET_KEY)) {
// regular users
ByteBuffer key = cursor.key();
ByteBuffer val = cursor.val();
do {
// advanced users
long keyAddress = cursor.keyAddress();
long keySize = cursor.keySize();
long valAddress = cursor.valAddress();
long keySize = cursor.valSize();
} while (cursor.get(MDB_NEXT));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment