public static void Put(this RocksDbSharp.WriteBatch batch, byte table, byte[] key, byte[] value) { Span <byte> dbkey = stackalloc byte[key.Length + 1]; dbkey[0] = table; key.AsSpan().CopyTo(dbkey.Slice(1)); batch.Put(dbkey.ToArray(), value); }
public void RocksdbInsert() { using (var batch = new rdb.WriteBatch()) { for (int i = 0; i < 10; i++) { batch.Put(new byte[] { 1 }.Concat(BitConverter.GetBytes(ldbInsertCount++)).ToArray(), data); } rocksdb.Write(batch); } }