* Class: org_rocksdb_RocksIterator * Method: key0 * Signature: (J)[B */
| 148 | * Signature: (J)[B |
| 149 | */ |
| 150 | jbyteArray Java_org_rocksdb_RocksIterator_key0(JNIEnv* env, jobject /*jobj*/, |
| 151 | jlong handle) { |
| 152 | auto* it = reinterpret_cast<rocksdb::Iterator*>(handle); |
| 153 | rocksdb::Slice key_slice = it->key(); |
| 154 | |
| 155 | jbyteArray jkey = env->NewByteArray(static_cast<jsize>(key_slice.size())); |
| 156 | if (jkey == nullptr) { |
| 157 | // exception thrown: OutOfMemoryError |
| 158 | return nullptr; |
| 159 | } |
| 160 | env->SetByteArrayRegion( |
| 161 | jkey, 0, static_cast<jsize>(key_slice.size()), |
| 162 | const_cast<jbyte*>(reinterpret_cast<const jbyte*>(key_slice.data()))); |
| 163 | return jkey; |
| 164 | } |
| 165 | |
| 166 | /* |
| 167 | * Class: org_rocksdb_RocksIterator |
nothing calls this directly
no test coverage detected