1

Here's my code:

@Override
public void put(String instance, final String storeName, final String key, final byte[] value) {
    final Environment env = Environments.newInstance(xodusRoot + instance);
    env.executeInTransaction(new TransactionalExecutable() {
        @Override
        public void execute(@NotNull final Transaction txn) {
            final Store store = env.openStore(storeName, StoreConfig.WITHOUT_DUPLICATES, txn);
            store.put(txn, StringBinding.stringToEntry(key), ByteBinding.byteToEntry(value));
        }
    });
    env.close();
}

Problem here is that the value that the ByteBinding can accept is only a byte how about Byte arrays?

quarks
  • 33,478
  • 73
  • 290
  • 513

1 Answers1

1

Use ArrayByteIterable class from openAPI:

store.put(txn, StringBinding.stringToEntry(key), new ArrayByteIterable(value));
Vyacheslav Lukianov
  • 1,913
  • 8
  • 12