private MultipartMessage StartReading(string contentType, byte[] data) { stream = new MemoryStream(data); reader = new MultipartMessageReader(stream); return reader.ReadHeader(contentType); }
//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); //} //private static MultipartMessage ParseMessage(string contentType, byte[] data) //{ // MultipartMessageParser parser = new MultipartMessageParser(); // using (MemoryStream stream = new MemoryStream(data)) // return parser.ParseMessage(contentType, stream); //} private MultipartMessage StartReading(string contentType, string content) { byte[] contentData = Encoding.UTF8.GetBytes(content); stream = new MemoryStream(contentData); reader = new MultipartMessageReader(stream); return reader.ReadHeader(contentType); }