本文整理汇总了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);
}
示例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]);
}
}
}
示例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);
}
}
示例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());
}
}
示例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);
}
}
示例6: bytesWrite
public override void bytesWrite(ByteBuffer data)
{
base.bytesWrite(data);
data.writeByte(0x6a);
}
示例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);
}
}
}
示例8: bytesWrite
public override void bytesWrite(ByteBuffer data)
{
base.bytesWrite(data);
data.writeByte(0x62);
data.writeDouble(this._value);
}
示例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;
}
}
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}