LevelDBWriteBatch implements AutoCloseable { public void put(byte[] key, byte[] value) { checkWriteBatchOpen(); if (Native.POINTER_SIZE == 8) { long keyLength = key != null ? key.length : 0; long valueLength = value != null ? value.length : 0; LevelDBNative.leveldb_writebatch_put(writeBatch, key, keyLength, value, valueLength); } else { int keyLength = key != null ? key.length : 0; int valueLength = value != null ? value.length : 0; LevelDBNative.leveldb_writebatch_put(writeBatch, key, keyLength, value, valueLength); } } LevelDBWriteBatch(); @Override void close(); void clear(); void put(byte[] key, byte[] value); void delete(byte[] key);  }
@Test public void put() { try(LevelDBWriteBatch writeBatch = new LevelDBWriteBatch()) { writeBatch.put(new byte[]{42}, new byte[]{43}); } }