Ejemplo n.º 1
0
        public FPData PeekHead(byte[] bytes)
        {
            if (bytes.Length < 12)
            {
                return(null);
            }

            FPData peek = new FPData();

            peek.SetMagic(this.GetByteArrayRange(bytes, 0, 3));
            peek.SetVersion(Array.IndexOf(FPConfig.FPNN_VERSION, bytes[4]));

            if (bytes[5] == FPConfig.FP_FLAG[0])
            {
                peek.SetFlag(0);
            }

            if (bytes[5] == FPConfig.FP_FLAG[1])
            {
                peek.SetFlag(1);
            }

            peek.SetMtype(Array.IndexOf(FPConfig.FP_MESSAGE_TYPE, bytes[6]));
            peek.SetSS(bytes[7]);
            peek.SetPsize((int)BitConverter.ToUInt32(this.GetByteArrayRange(bytes, 8, 11), 0));

            return(peek);
        }