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


C# ByteBuffer.writeByte方法代码示例

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


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

示例1: bytesWrite

 public override void bytesWrite(ByteBuffer data)
 {
     base.bytesWrite(data);
     if (!this.isServer) {
         data.writeShort(2);
     }
     //data.writeShort(2);
     data.writeByte(0x61);
     data.writeByte(this._value);
 }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:10,代码来源:ErlByte.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
     {
         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

示例3: 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

示例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.writeShort(this._value.length() + 1);
         data.writeByte(0x6d);
         data.writeBytes(this._value, 0, (uint) this._value.length());
     }
 }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:14,代码来源:ErlByteArray.cs

示例5: bytesWriteKey

 public void bytesWriteKey(ByteBuffer data, string key)
 {
     if (key != null)
     {
         byte[] b = StringKit.DefaultToUTF8Byte(key);
         data.writeByte(b.Length);
         data.writeBytes(b);
     }
     else
     {
         data.writeByte(0);
     }
 }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:13,代码来源:ErlKVMessageClient.cs

示例6: bytesWrite

 public override void bytesWrite(ByteBuffer data)
 {
     base.bytesWrite(data);
     data.writeByte(0x6a);
 }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:5,代码来源:ErlNullList.cs

示例7: 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

示例8: bytesWrite

 public override void bytesWrite(ByteBuffer data)
 {
     base.bytesWrite(data);
     data.writeByte(0x62);
     data.writeDouble(this._value);
 }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:6,代码来源:ErlDouble.cs

示例9: 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

示例10: encryptionCode

 private ByteBuffer encryptionCode(ByteBuffer data, int[] code)
 {
     byte[] buffer = CodecKit.encodeXor (data.toArray (), this.nextPK (code));
     data = new ByteBuffer ();
     for (int i = 0; i < buffer.Length; i++) {
         data.writeByte (buffer [i]);
     }
     data.position = 0;
     return data;
 }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:10,代码来源:ErlConnect.cs

示例11: 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

示例12: bytesWriteValue

    public void bytesWriteValue(ByteBuffer sc_data, object value)
    {
        ErlType type = value as ErlType;
        if (type == null)
        {
            type = new ErlNullList();
        }
        ByteBuffer data = new ByteBuffer();

        if (type.GetType ().ToString () == "ErlArray"||type.GetType ().ToString () == "ErlAtom") {
            data.writeByte ((byte)0x83);
            Log.Info (type.GetType ().ToString ());
            type.bytesWriteServer (data);
            sc_data.writeByte (0);
            sc_data.writeByte ((byte)data.bytesAvailable);
            sc_data.writeBytes (data, 0, data.bytesAvailable);
        } else {
            type.bytesWrite (data);
            sc_data.writeBytes (data, 0, data.bytesAvailable);
        }
    }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:21,代码来源:ErlKVMessage.cs

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