Ejemplo n.º 1
0
        static byte[] FormatMessage(BitStream payload, ushort domainId, ushort typeId, ulong senderId)
        {
            Log.Entered();
            BitStream stream = new BitStream();

            stream.ResetWrite();
            HandlerRegistrar.SerializeHeaders(ref stream, ref domainId, ref typeId, ref senderId);
            Log.Trace($"Adding payload of length {payload.ByteLength} to formatted message of length {stream.ByteLength}");
            payload.ResetRead();
            stream.WriteBitStream(payload);
            Log.Trace($"Formatted message final length {stream.ByteLength}");
            return(stream.ToBytes());
        }