当前位置: 首页>>代码示例>>C#>>正文


C# Value.Pack方法代码示例

本文整理汇总了C#中Aerospike.Client.Value.Pack方法的典型用法代码示例。如果您正苦于以下问题:C# Value.Pack方法的具体用法?C# Value.Pack怎么用?C# Value.Pack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Aerospike.Client.Value的用法示例。


在下文中一共展示了Value.Pack方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Append

 /// <summary>
 /// Create list append operation.
 /// Server appends value to end of list bin.
 /// Server returns list size.
 /// </summary>
 public static Operation Append(string binName, Value value)
 {
     Packer packer = new Packer();
     packer.PackRawShort(APPEND);
     packer.PackArrayBegin(1);
     value.Pack(packer);
     byte[] bytes = packer.ToByteArray();
     return new Operation(Operation.Type.CDT_MODIFY, binName, Value.Get(bytes));
 }
开发者ID:Caldas,项目名称:aerospike-client-csharp,代码行数:14,代码来源:ListOperation.cs

示例2: CreateOperation

 protected internal static Operation CreateOperation(int command, int attributes, string binName, Value value1, Value value2)
 {
     Packer packer = new Packer();
     packer.PackRawShort(command);
     packer.PackArrayBegin(3);
     value1.Pack(packer);
     value2.Pack(packer);
     packer.PackNumber(attributes);
     return new Operation(Operation.Type.MAP_MODIFY, binName, Value.Get(packer.ToByteArray()));
 }
开发者ID:Caldas,项目名称:aerospike-client-csharp,代码行数:10,代码来源:MapBase.cs

示例3: CreateRangeOperation

        protected internal static Operation CreateRangeOperation(int command, Operation.Type type, string binName, Value begin, Value end, MapReturnType returnType)
        {
            Packer packer = new Packer();
            packer.PackRawShort(command);

            if (begin == null)
            {
                begin = Value.AsNull;
            }

            if (end == null)
            {
                packer.PackArrayBegin(2);
                packer.PackNumber((int)returnType);
                begin.Pack(packer);
            }
            else
            {
                packer.PackArrayBegin(3);
                packer.PackNumber((int)returnType);
                begin.Pack(packer);
                end.Pack(packer);
            }
            return new Operation(type, binName, Value.Get(packer.ToByteArray()));
        }
开发者ID:Caldas,项目名称:aerospike-client-csharp,代码行数:25,代码来源:MapBase.cs

示例4: CreatePut

        protected internal static Operation CreatePut(int command, int attributes, string binName, Value value1, Value value2)
        {
            Packer packer = new Packer();
            packer.PackRawShort(command);

            if (command == MapBase.REPLACE)
            {
                // Replace doesn't allow map attributes because it does not create on non-existing key.
                packer.PackArrayBegin(2);
                value1.Pack(packer);
                value2.Pack(packer);
            }
            else
            {
                packer.PackArrayBegin(3);
                value1.Pack(packer);
                value2.Pack(packer);
                packer.PackNumber(attributes);
            }
            return new Operation(Operation.Type.MAP_MODIFY, binName, Value.Get(packer.ToByteArray()));
        }
开发者ID:Caldas,项目名称:aerospike-client-csharp,代码行数:21,代码来源:MapBase.cs

示例5: Set

 /// <summary>
 /// Create list set operation.
 /// Server sets item value at specified index in list bin.
 /// Server does not return a result by default.
 /// </summary>
 public static Operation Set(string binName, int index, Value value)
 {
     Packer packer = new Packer();
     packer.PackRawShort(SET);
     packer.PackArrayBegin(2);
     packer.PackNumber(index);
     value.Pack(packer);
     byte[] bytes = packer.ToByteArray();
     return new Operation(Operation.Type.CDT_MODIFY, binName, Value.Get(bytes));
 }
开发者ID:Caldas,项目名称:aerospike-client-csharp,代码行数:15,代码来源:ListOperation.cs


注:本文中的Aerospike.Client.Value.Pack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。