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