File tree Expand file tree Collapse file tree
src/main/java/org/lmdbjava Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,6 +125,37 @@ public boolean first() {
125125 return seek (MDB_FIRST );
126126 }
127127
128+ /**
129+ * Reposition the key/value buffers based on the passed key and operation.
130+ *
131+ * @param key to search for
132+ * @param data to search for
133+ * @param op options for this operation
134+ * @return false if key not found
135+ */
136+ public boolean get (final T key , final T data , final SeekOp op ) {
137+ if (SHOULD_CHECK ) {
138+ requireNonNull (key );
139+ requireNonNull (op );
140+ checkNotClosed ();
141+ txn .checkReady ();
142+ }
143+ kv .keyIn (key );
144+ kv .valIn (data );
145+
146+ final int rc = LIB .mdb_cursor_get (ptrCursor , kv .pointerKey (), kv
147+ .pointerVal (), op .getCode ());
148+
149+ if (rc == MDB_NOTFOUND ) {
150+ return false ;
151+ }
152+
153+ checkRc (rc );
154+ kv .keyOut ();
155+ kv .valOut ();
156+ return true ;
157+ }
158+
128159 /**
129160 * Reposition the key/value buffers based on the passed key and operation.
130161 *
You can’t perform that action at this time.
0 commit comments