public WriteOptions(bool sync) { _handle = LevelDBInterop.leveldb_writeoptions_create(); if (sync) { LevelDBInterop.leveldb_writeoptions_set_sync(_handle, sync ? (byte)1 : (byte)0); } }
public void Put() { var options = LevelDBInterop.leveldb_writeoptions_create(); this.InnerPut(options, "key1", "value1"); this.InnerPut(options, "key2", "value2"); this.InnerPut(options, "key3", "value3"); // sync LevelDBInterop.leveldb_writeoptions_set_sync(options, 1); this.InnerPut(options, "key4", "value4"); }