Пример #1
0
        private static MultipartMessage ParseMessage(string contentType, byte[] data)
        {
            MultipartMessageParser parser = new MultipartMessageParser();

            using (MemoryStream stream = new MemoryStream(data))
                return(parser.ParseMessage(contentType, stream));
        }
Пример #2
0
        private static MultipartMessage ParseMessage(string contentType, string content)
        {
            MultipartMessageParser parser = new MultipartMessageParser();

            byte[] contentData = Encoding.UTF8.GetBytes(content);

            if (log.IsDebugEnabled)
            {
                log.DebugFormat("content: {0}", contentData.ArrayToString());
            }

            using (MemoryStream stream = new MemoryStream(contentData))
                return(parser.ParseMessage(contentType, stream));
        }