ReadShort() публичный Метод

2字节读出
public ReadShort ( ) : ushort
Результат ushort
Пример #1
0
    void OnReceivedInternal(MemoryStream ms)
    {
        BinaryReader br = new BinaryReader(ms);

        byte[] message = br.ReadBytes((int)(ms.Length - ms.Position));
        br.Close();
        ms.Close();
        ms.Dispose();

        NetBuffer temp = new NetBuffer(message);
        ushort    cmd  = temp.ReadShort();

        byte[] buf = temp.ReadRemaining();
        SocketClientManager.AddEvent(cmd.ToString(), new NetBuffer(buf));
    }
Пример #2
0
 public override void ReadFromBuffer(NetBuffer buffer)
 {
     value = buffer.ReadShort();
 }
Пример #3
0
    void OnReceivedInternal(MemoryStream ms)
    {
        BinaryReader br = new BinaryReader(ms);
        byte[] message = br.ReadBytes((int)(ms.Length - ms.Position));
        br.Close();
        ms.Close();
        ms.Dispose();

        NetBuffer temp = new NetBuffer(message);
        ushort cmd = temp.ReadShort();
        byte[] buf = temp.ReadRemaining();
        SocketClientManager.AddEvent(cmd.ToString(), new NetBuffer(buf));
    }