Esempio n. 1
0
 internal void CommitLastDictId(ulong newLastDictId, IKeyValueDBTransaction tr)
 {
     if (_lastDictId != newLastDictId)
     {
         tr.SetKeyPrefix(null);
         var w = new ByteBufferWriter();
         w.WriteVUInt64(newLastDictId);
         tr.CreateOrUpdateKeyValue(LastDictIdKey, w.Data.ToByteArray());
         _lastDictId = newLastDictId;
     }
 }
Esempio n. 2
0
 public byte[] ToConfiguration()
 {
     var writer = new ByteBufferWriter();
     writer.WriteVUInt32((_signed ? 1u : 0) + (Flags ? 2u : 0) + 4u * (uint)Names.Length);
     foreach (var name in Names)
     {
         writer.WriteString(name);
     }
     foreach (var value in Values)
     {
         if (_signed) writer.WriteVInt64((long)value);
         else writer.WriteVUInt64(value);
     }
     return writer.Data.ToByteArray();
 }