本文整理汇总了C#中Aerospike.Client.Value.Write方法的典型用法代码示例。如果您正苦于以下问题:C# Value.Write方法的具体用法?C# Value.Write怎么用?C# Value.Write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aerospike.Client.Value
的用法示例。
在下文中一共展示了Value.Write方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteField
private void WriteField(Value value, int type)
{
int offset = dataOffset + FIELD_HEADER_SIZE;
dataBuffer[offset++] = (byte)value.Type;
int len = value.Write(dataBuffer, offset) + 1;
WriteFieldHeader(len, type);
dataOffset += len;
}
示例2: ComputeDigest
/// <summary>
/// Generate unique server hash value from set name, key type and user defined key.
/// The hash function is RIPEMD-160 (a 160 bit hash).
/// </summary>
/// <param name="setName">optional set name, enter null when set does not exist</param>
/// <param name="key">record identifier, unique within set</param>
/// <returns>unique server hash value</returns>
/// <exception cref="AerospikeException">if digest computation fails</exception>
public static byte[] ComputeDigest(string setName, Value key)
{
byte[] buffer = ThreadLocalData.GetBuffer();
int offset = ByteUtil.StringToUtf8(setName, buffer, 0);
buffer[offset++] = (byte)key.Type;
offset += key.Write(buffer, offset);
return Hash.Algorithm.ComputeHash(buffer, 0, offset);
}