示例#1
0
        public void SetReport(CmppMessageReport report)
        {
            byte[] buffer = null;
            using (var ms = new MemoryStream())
            {
                using (var writer = new BinaryWriter(ms))
                {
                    report.NetworkWrite(writer);
                }

                buffer = ms.ToArray();
            }

            this.Content = Convert.ToBase64String(buffer);
        }
示例#2
0
        public CmppMessageReport GetReport()
        {
            CmppMessageReport report = null;

            if (this.DeliveryReportRequired == 0)//deliver up link
            {
                report = new CmppMessageReport();
                return(report);
            }

            var buffer = Convert.FromBase64String(this.Content);

            report = new CmppMessageReport(buffer.Length);

            using (var reader = new BinaryReader(
                       new MemoryStream(buffer)))
            {
                report.NetworkRead(reader);
            }

            return(report);
        }