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


C# ByteBuffer.writeInt方法代码示例

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


在下文中一共展示了ByteBuffer.writeInt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
         //(new ErlType[0]).
         data.writeByte(TAG[0]);
         data.writeByte(0);
     }
     else
     {
         if (this._value.Length > 0xff)
         {
             data.writeByte(TAG[1]);
             data.writeInt(this._value.Length);
         }
         else
         {
             data.writeByte(TAG[0]);
             data.writeByte(this._value.Length);
         }
         for (int i = 0; i < this._value.Length; i++)
         {
             ErlBytesWriter writer = this._value[i];
             if (writer == null)
             {
                 writer = new ErlNullList();
             }
             writer.bytesWriteServer(data);
         }
     }
 }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:33,代码来源:ErlArray.cs

示例3: sendErl

    public void sendErl(ByteBuffer data, int encryption, int crc, int compress, int kv)
    {
        if ((this._sendChallengeCode != null) && (this._sendChallengeCode.Length >= 0)) {
            this._encryption = encryption;
            this._crc = crc;
            this._compress = compress;
            this._kv = kv;
            int i = 0;
            ByteBuffer buffer = new ByteBuffer ();
            if ((this._compress == 1) && (data.length () >= 0x40)) {
                data = new ByteBuffer (ZIPUtil.Compress (data.toArray ()));
            } else {
                this._compress = 0;
            }
            if ((this._crc == 1) && (this._compress == 0)) {
                i = (int)ChecksumUtil.Adler32 (data);
                buffer.writeInt (i);
            } else {
                this._crc = 0;
            }
            buffer.writeBytes (data.toArray ());
            if (this._encryption == 1) {
                if (!this.isServer) {
                    buffer = this.encryptionCode (buffer, this._receiveChallengeCode);
                    /*string code = "";
                    foreach(int sc in this._receiveChallengeCode)
                    {
                        code = code + sc ;
                    }
                    //Log.Info("---this._receiveChallengeCode="+ code);
                     */
                } else {
                    buffer = this.encryptionCode (buffer, this._sendChallengeCode);
                    /*string code = "";
                    foreach(int sc in this._sendChallengeCode)
                    {
                        code = code + sc ;
                    }
                    Log.Info("---this._sendChallengeCode="+ code);
                     */
                }

                //buffer = this.encryptionCode (buffer, this._receiveChallengeCode);
            }
            base.send (buffer);
            //Log.Info(string.Concat(buffer.getArray()));
            this._encryption = 1;
            this._crc = 1;
            this._compress = 1;
            this._kv = 1;
        }
    }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:52,代码来源:ErlConnect.cs

示例4: toPK

 protected byte[] toPK(int[] pks)
 {
     ByteBuffer buffer = new ByteBuffer ();
     buffer.writeInt (pks [0]);
     buffer.writeInt (pks [1]);
     buffer.writeInt (pks [2]);
     buffer.writeInt (pks [3]);
     buffer.writeInt (pks [4]);
     buffer.writeInt (pks [5]);
     buffer.writeInt (pks [6]);
     buffer.writeInt (pks [7]);
     return buffer.getArray ();
 }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:13,代码来源:ErlConnect.cs

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