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


C# ByteBuffer.writeShort方法代码示例

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


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

示例1: bytesWrite

 public override void bytesWrite(ByteBuffer data)
 {
     base.bytesWrite(data);
     if (!this.isServer) {
         data.writeShort (5);
     }
     data.writeByte(0x62);
     data.writeInt(this._value);
 }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:9,代码来源:ErlInt.cs

示例2: bytesWrite

    public override void bytesWrite(ByteBuffer data)
    {
        base.bytesWrite(data);
        if ((this._value == null) || (this._value.Length < 1))
        {
            new ErlNullList().bytesWrite(data);
        }
        else
        {
            ByteBuffer b = new ByteBuffer();
            data.writeBytes(b, 0, b.bytesAvailable);
            b.writeUTFBytes (this._value);
            if (base.isServer) {
                data.writeByte (0x6b);
                data.writeShort(b.top );
            } else {
                data.writeShort(b.top + 1);
                data.writeByte (0x6b);
            }

            data.writeBytes(b, 0, b.bytesAvailable);
        }
    }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:23,代码来源:ErlString.cs

示例3: bytesWrite

 public override void bytesWrite(ByteBuffer data)
 {
     base.bytesWrite(data);
     if ((this._value == null) || (this._value.length() < 1))
     {
         new ErlNullList().bytesWrite(data);
     }
     else
     {
         data.writeShort(this._value.length() + 1);
         data.writeByte(0x6d);
         data.writeBytes(this._value, 0, (uint) this._value.length());
     }
 }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:14,代码来源:ErlByteArray.cs

示例4: bytesWrite

 public override void bytesWrite(ByteBuffer data)
 {
     base.bytesWrite(data);
     if ((this._value == null) || (this._value.Length < 1))
     {
         new ErlNullList().bytesWrite(data);
     }
     else
     {
         data.writeByte(100);
         data.writeShort(this._value.Length);
         for (int i = 0; i < this._value.Length; i++)
         {
             data.writeByte((char)this.Value [i]);
         }
     }
 }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:17,代码来源:ErlAtom.cs

示例5: ping

 public virtual void ping()
 {
     long num = TimeKit.getMillisTime();
     Connect[] connectArray = this.connectArray.ToArray();
     for (int i = connectArray.Length - 1; i >= 0; i--)
     {
         Connect connect = connectArray[i];
         if (connect.Active)
         {
             if (connect.PingTime == 0)
             {
                 connect.PingTime = num;
                 ByteBuffer data = new ByteBuffer();
                 data.writeShort(1);
                 data.writeByte(1);
                 connect.send(data);
             }
             else
             {
                 connect.ping = num - connect.PingTime;
             }
         }
     }
 }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:24,代码来源:ConnectFactory.cs

示例6: createDataByHead

 protected override ByteBuffer createDataByHead(ByteBuffer head)
 {
     ByteBuffer buffer = new ByteBuffer ();
     int b = (((0 | (this._encryption << 3)) | (this._crc << 2)) | (this._compress << 1)) | this._kv;
     buffer.writeShort (head.length () + 1);
     buffer.writeByte (b);
     buffer.writeBytes (head.toArray ());
     return buffer;
 }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:9,代码来源:ErlConnect.cs

示例7: writeLength

 public static int writeLength(ByteBuffer data, int len, int pos)
 {
     if ((len >= 0x20000000) || (len < 0))
     {
         throw new Exception(typeof(ByteKit).ToString() + " writeLength, invalid len:" + len);
     }
     if (len >= 0x4000)
     {
         data.writeInt(len + 0x20000000);
         return 4;
     }
     if (len >= 0x80)
     {
         data.writeShort((short) (len + 0x4000));
         return 2;
     }
     data.writeByte((byte) (len + 0x80));
     return 1;
 }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:19,代码来源:ByteKitClient.cs


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