static TextMessageEncoderFactory.ContentEncoding[] GetContentEncodingMap(string mediaType)
 {
     Encoding[] readEncodings = TextMessageEncoderFactory.GetSupportedEncodings();
     TextMessageEncoderFactory.ContentEncoding[] map = new TextMessageEncoderFactory.ContentEncoding[readEncodings.Length];
     for (int i = 0; i < readEncodings.Length; i++)
     {
         TextMessageEncoderFactory.ContentEncoding contentEncoding = new TextMessageEncoderFactory.ContentEncoding();
         contentEncoding.contentType = WebMessageEncoderFactory.GetContentType(mediaType, readEncodings[i]);
         contentEncoding.encoding    = readEncodings[i];
         map[i] = contentEncoding;
     }
     return(map);
 }
 static TextMessageEncoderFactory.ContentEncoding[] GetContentEncodingMap(string mediaType)
 {
     Encoding[] readEncodings = TextMessageEncoderFactory.GetSupportedEncodings();
     TextMessageEncoderFactory.ContentEncoding[] map = new TextMessageEncoderFactory.ContentEncoding[readEncodings.Length];
     for (int i = 0; i < readEncodings.Length; i++)
     {
         TextMessageEncoderFactory.ContentEncoding contentEncoding = new TextMessageEncoderFactory.ContentEncoding();
         contentEncoding.contentType = WebMessageEncoderFactory.GetContentType(mediaType, readEncodings[i]);
         contentEncoding.encoding = readEncodings[i];
         map[i] = contentEncoding;
     }
     return map;
 }