Beispiel #1
0
        public byte[] GetBinData()
        {
            IoBufferWriter wr = new IoBufferWriter();

            wr.Write(saveData);
            return(wr.ToBytes());
        }
Beispiel #2
0
        public byte[] toByte(Msg msg)
        {
            Dictionary <Object, Object> param = msg.ParamMap;
            IoBufferWriter wr = new IoBufferWriter();

            wr.Buffer.WriteInt(msg.Cmd);
            wr.Write(param);
            byte[] rs = wr.ToBytes();
            return(rs);
        }
Beispiel #3
0
        public byte[] encode(Msg msg)
        {
            IoBufferWriter wr = new IoBufferWriter();

            byte[] data = toByte(msg);
            int    len  = data.Length;

            if (logReport != null)
            {
                logReport.OnDebugReport("encode msg len:" + len);
            }
            wr.Buffer.WriteInt(len);
            wr.Buffer.WriteByts(data);
            return(wr.ToBytes());
        }