本文整理汇总了C#中ByteBuffer.readBytes方法的典型用法代码示例。如果您正苦于以下问题:C# ByteBuffer.readBytes方法的具体用法?C# ByteBuffer.readBytes怎么用?C# ByteBuffer.readBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ByteBuffer
的用法示例。
在下文中一共展示了ByteBuffer.readBytes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: bytesRead
public override void bytesRead(ByteBuffer data)
{
base.bytesRead(data);
if (this.isTag(base._tag))
{
data.position -= 3;
int len = data.readUnsignedShort() - 1;
data.readByte();
uint position = (uint) data.position;
this._byteArray.clear();
data.readBytes(this._byteArray, 0, len);
this._value = this._byteArray.readUTFBytes(len);
}
}
示例2: bytesRead
public override void bytesRead(ByteBuffer data)
{
base.bytesRead(data);
if (this.isTag(base._tag))
{
int len = data.readUnsignedByte();
int num2 = data.readUnsignedByte();
byte[] bytes = new byte[8];
data.readBytes(bytes, 0, len);
this._value = BitConverter.ToInt64(bytes, 0);
if (num2 == 1)
{
this._value = -this._value;
}
}
}
示例3: procCmd
public Boolean procCmd(int _port , BaseFPort fport)
{
if (needProcCmdDict.ContainsKey(_port)) {
string cCmd = needProcCmdDict [_port];
if (FilterCmdDict [cCmd]._count >= FilterCmdDict [cCmd]._beginCount) {
String strValue = ConfigHelper.GetAppConfig (cCmd);
ErlKVMessage msg = new ErlKVMessage ("r_ok");
msg.addValue (null, new ErlInt (_port));
ErlType[] et = StringKit.strToErlTypeArray (strValue);
ErlArray ea = new ErlArray (et);
msg.addValue ("msg", ea);
Log.Info(msg.Cmd+"|"+ msg.toJsonString());
ByteBuffer data = new ByteBuffer();
//data.writeBytes (mybak);
msg.bytesWrite(data);
data.top = (int)data.bytesAvailable;
byte[] tmpdata= new byte[(int)data.bytesAvailable];
data.readBytes (tmpdata, 0, tmpdata.Length);
fport.erlConnect.tmpBuffer.position = 0;
Log.Info (fport.erlConnect.tmpBuffer) ;
ByteBuffer tmp1 = new ByteBuffer();
tmp1.writeBytes (tmpdata);
//this.erlConnect.send (this.erlConnect.tmpBuffer);
if (fport.erlConnect.socket.Connected) {
fport.send (fport.erlConnect, msg);
} else {
Log.Info ("客户端已断开不再回传");
}
//base.erlConnect.socket.Send (bak);
FilterCmdDict [cCmd]._count--;
Log.Info ("处理完成的CMD[" + cCmd + "]");
return true ;
}
}
return false;
}
示例4: sampleBytesRead
public void sampleBytesRead(ByteBuffer data)
{
base.bytesRead(data);
if (this.isTag(base._tag))
{
//data.position = data.position - 3;
uint num = (uint) data.readUnsignedShort();
this._value = string.Empty;
uint position = (uint) data.position;
this._byteArray.clear();
data.readBytes(this._byteArray, 0, (int) num);
data.position = (int) position;
this._value = this._value + data.readUTFBytes((int) num);
}
}