本文整理汇总了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);
}
示例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);
}
}
示例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());
}
}
示例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]);
}
}
}
示例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;
}
}
}
}
示例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;
}
示例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;
}